diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-11-28 00:00:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-11-28 00:00:38 +0900 |
| commit | 5f6941aa610fcc82c34782ed140b83b4497fd048 (patch) | |
| tree | 0b36056c36db563c82694b055fd23f9ece0fd127 /.config/nvim/after/ftplugin/php.lua | |
| parent | b73d4c0bff913467628ecddd2b5ac9eb66f55118 (diff) | |
| download | dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.tar.gz dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.tar.zst dotfiles-5f6941aa610fcc82c34782ed140b83b4497fd048.zip | |
neovim: rewrite after/ftplugin/* in Lua
Diffstat (limited to '.config/nvim/after/ftplugin/php.lua')
| -rw-r--r-- | .config/nvim/after/ftplugin/php.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.config/nvim/after/ftplugin/php.lua b/.config/nvim/after/ftplugin/php.lua new file mode 100644 index 0000000..8c03f57 --- /dev/null +++ b/.config/nvim/after/ftplugin/php.lua @@ -0,0 +1,15 @@ +vimrc.after_ftplugin('php', function(conf) + conf.indent(conf.SPACE, 2) + + -- 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). + -- + -- Example: + -- <?php + -- + -- [cursor] + if vim.fn.line('$') == 1 and vim.fn.getline(1) == '' then + vim.fn.setline(1, { '<?php', '', '' }) + vim.fn.cursor(3, 0) + end +end) |
