diff options
| author | Brahmajit Das <listout@listout.xyz> | 2026-01-13 18:45:56 +0000 |
|---|---|---|
| committer | Brahmajit Das <listout@listout.xyz> | 2026-01-13 18:45:56 +0000 |
| commit | 4d934621751e5949f85b9b559c3330acafe165b2 (patch) | |
| tree | be61f0fa1c04822eabe5a117d08e511657da65bd /init.lua | |
| parent | 93be902bd22d03b94ff45c6f4eedf9dc9772c055 (diff) | |
| download | nvim-4d934621751e5949f85b9b559c3330acafe165b2.tar.gz | |
Signed-off-by: Brahmajit Das <listout@listout.xyz>
Diffstat (limited to '')
| -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" |
