remember where I left off

This commit is contained in:
Thomas Ruoff
2024-10-02 10:04:04 +02:00
parent 5c73672381
commit 2863a2561e

View File

@@ -6,6 +6,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end, end,
}) })
-- return to last cursor position when reopening a file
vim.api.nvim_create_autocmd('BufReadPost', {
callback = function()
local last_pos = vim.fn.line '\'"'
if last_pos > 1 and last_pos <= vim.fn.line '$' then
vim.cmd 'normal! g`"'
end
end,
})
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
pattern = { pattern = {
'checkhealth', 'checkhealth',