mirror of
https://github.com/tomru/nvim.git
synced 2026-03-04 06:57:15 +01:00
remember where I left off
This commit is contained in:
@@ -6,6 +6,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
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', {
|
||||
pattern = {
|
||||
'checkhealth',
|
||||
|
||||
Reference in New Issue
Block a user