diff options
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -6,5 +6,19 @@ end -- Change leader to a comma vim.g.mapleader = ',' +-- When editing a file, always jump to the last cursor position +vim.api.nvim_create_autocmd("BufReadPost", { + callback = function() + if vim.g.leave_my_cursor_position_alone then + return + end + + local last_line = vim.fn.line([['"]]) + if last_line > 0 and last_line <= vim.fn.line("$") then + vim.cmd.normal({ args = { [[g'"]] }, bang = true }) + end + end, +}) + require("config.lazy") vim.cmd.colorscheme "jellybeans-nvim" |
