Remove remember.nvim in favor of custom minimal lua autocmd in autocmd.lua

This commit is contained in:
Imbus 2026-03-05 17:54:57 +01:00
parent 3ed5a224f9
commit 03c16904b7
2 changed files with 14 additions and 4 deletions

View file

@ -20,4 +20,18 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})
-- Jump to last edit position when opening a file
vim.api.nvim_create_autocmd('BufReadPost', {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"') -- the '"' mark stores last position
local line = mark[1]
local col = mark[2]
local last_line = vim.api.nvim_buf_line_count(0)
-- Only jump if the line exists in the file
if line > 0 and line <= last_line then
vim.api.nvim_win_set_cursor(0, { line, col })
end
end,
})
-- vim: ts=2 sts=2 sw=2 et

View file

@ -14,10 +14,6 @@ require('lazy').setup({
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
'lambdalisue/vim-suda',
-- Remember position
{ 'vladdoster/remember.nvim', opts = {} },
-- Terminal
{'akinsho/toggleterm.nvim', version = "*", config = true},