aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/nvim/after/ftplugin/php.lua
blob: f6433f5f03d3ad6544a28489576b3040e5073e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
vimrc.after_ftplugin('php', function(conf)
   -- 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', '', 'declare(strict_types=1);', '', '' })
      vim.fn.cursor(6, 0)
   end
end)