From 2d697c3ebe0e35a8e8fe39eeb9d8f8a59bf0e248 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 17 Jan 2025 10:13:02 +0100 Subject: nvim: add lastplace plugin, remove autocmd --- .config/nvim/lua/helpers/autocmds.lua | 18 ------------------ 1 file changed, 18 deletions(-) (limited to '.config/nvim/lua/helpers') diff --git a/.config/nvim/lua/helpers/autocmds.lua b/.config/nvim/lua/helpers/autocmds.lua index bf2c325..7461090 100644 --- a/.config/nvim/lua/helpers/autocmds.lua +++ b/.config/nvim/lua/helpers/autocmds.lua @@ -109,24 +109,6 @@ vim.api.nvim_create_autocmd({ "VimResized" }, { end, }) --- go to last loc when opening a buffer -vim.api.nvim_create_autocmd("BufReadPost", { - group = augroup("last_loc"), - callback = function(event) - local exclude = { "gitcommit" } - local buf = event.buf - if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then - return - end - vim.b[buf].lazyvim_last_loc = true - local mark = vim.api.nvim_buf_get_mark(buf, '"') - local lcount = vim.api.nvim_buf_line_count(buf) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end - end, -}) - -- close some filetypes with vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), -- cgit v1.2.3-70-g09d2