dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

remember-position.nix (476B)


      1 {
      2   programs.neovim.customPlugins.remember-position= {
      3     "plugin/remember-position.lua" = # lua
      4       ''
      5         vim.api.nvim_create_autocmd('BufReadPost', {
      6           group = vim.api.nvim_create_augroup('ReturnToLastLine', { clear = true }),
      7           callback = function()
      8             local last = vim.fn.line([['"]])
      9             if last > 1 and last < vim.fn.line("$") then
     10               vim.cmd([[normal! g'"]])
     11             end
     12           end
     13         })
     14       '';
     15   };
     16 }