From 09b8483ed67d3b85e983ef86c34260081975e1cb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 2 May 2025 06:47:07 +0900 Subject: fix(blog/nuldoc): remove unnecessary "language" attribute --- .../index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vhosts/blog/public/posts/2024-01-10/neovim-insert-namespace-declaration-to-empty-php-file/index.html') diff --git a/vhosts/blog/public/posts/2024-01-10/neovim-insert-namespace-declaration-to-empty-php-file/index.html b/vhosts/blog/public/posts/2024-01-10/neovim-insert-namespace-declaration-to-empty-php-file/index.html index 27eede1c..4a52d698 100644 --- a/vhosts/blog/public/posts/2024-01-10/neovim-insert-namespace-declaration-to-empty-php-file/index.html +++ b/vhosts/blog/public/posts/2024-01-10/neovim-insert-namespace-declaration-to-empty-php-file/index.html @@ -75,7 +75,7 @@

Neovim で空の PHP ファイルを開いたとき、そのファイルが置かれているディレクトリの構造に基づいて、自動的に namespace 宣言を挿入したい。具体的には、トップレベルの名前空間が MyNamespace であり、ファイル src/Foo/Bar/Baz.php を開いたときに、そのファイルが空であるなら、次のようなテンプレートが自動的に挿入されてほしい。

-
+
<?php
 
 namespace MyNamespace\Foo\Bar;
@@ -110,7 +110,7 @@

ファイルタイプは読み込んだあとに変更されることもあるので、ftplugin は複数回実行されうる。 二重読み込みを防ぐために、did_ftplugin_<FILE_TYPE>_after というバッファローカル変数を定義しておくのが慣習となっている。

-
+
if vim.b.did_ftplugin_php_after then
    return
 end
@@ -148,7 +148,7 @@
             

実装を簡単にするため、Composer を用いない場合や PSR 4 以外のオートロード規則を使う場合には対応しない。少々長くなるが、以下にスクリプト全文を載せる。

-
+
if vim.b.did_ftplugin_php_after then
    return
 end
-- 
cgit v1.2.3-70-g09d2