jump to last position in nvim

This commit is contained in:
Thies Lennart Alff 2024-02-19 11:06:08 +01:00
parent 3d970d1cac
commit 9387b20b76

View file

@ -31,3 +31,15 @@ vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes'
vim.opt.updatetime = 500
vim.opt.colorcolumn = '80'
vim.api.nvim_create_autocmd('BufReadPost', {
group = vim.g.user.event,
callback = function(args)
local valid_line = vim.fn.line([['"]]) >= 1 and vim.fn.line([['"]]) < vim.fn.line('$')
local not_commit = vim.b[args.buf].filetype ~= 'commit'
if valid_line and not_commit then
vim.cmd([[normal! g`"]])
end
end,
})