aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/after/ftplugin/php.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/.config/nvim/after/ftplugin/php.lua b/.config/nvim/after/ftplugin/php.lua
index 9e4b15b..f6433f5 100644
--- a/.config/nvim/after/ftplugin/php.lua
+++ b/.config/nvim/after/ftplugin/php.lua
@@ -1,13 +1,15 @@
vimrc.after_ftplugin('php', function(conf)
- -- If a buffer is empty, insert `<?php` tag and 2 blank lines, and position the
- -- cursor at the end of the buffer (line 3, column 0).
+ -- If a buffer is empty, insert a template and position the
+ -- cursor at the end of the buffer.
--
-- Example:
-- <?php
--
+ -- declare(strict_types=1);
+ --
-- [cursor]
if vim.fn.line('$') == 1 and vim.fn.getline(1) == '' then
- vim.fn.setline(1, { '<?php', '', '' })
- vim.fn.cursor(3, 0)
+ vim.fn.setline(1, { '<?php', '', 'declare(strict_types=1);', '', '' })
+ vim.fn.cursor(6, 0)
end
end)