Restore last position when opening a buffer
This commit is contained in:
8
lua/restore-position.lua
Normal file
8
lua/restore-position.lua
Normal file
@ -0,0 +1,8 @@
|
||||
-- Restore cursor position
|
||||
-- Adapted from https://stackoverflow.com/a/72939989/10585637
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost" }, {
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
vim.api.nvim_exec2('silent! normal! g`"zv', {})
|
||||
end,
|
||||
})
|
Reference in New Issue
Block a user