diff options
Diffstat (limited to '.config/nvim/lua/helpers')
-rw-r--r-- | .config/nvim/lua/helpers/autocmds.lua | 18 |
1 files changed, 0 insertions, 18 deletions
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" }, { | |||
109 | end, | 109 | end, |
110 | }) | 110 | }) |
111 | 111 | ||
112 | -- go to last loc when opening a buffer | ||
113 | vim.api.nvim_create_autocmd("BufReadPost", { | ||
114 | group = augroup("last_loc"), | ||
115 | callback = function(event) | ||
116 | local exclude = { "gitcommit" } | ||
117 | local buf = event.buf | ||
118 | if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then | ||
119 | return | ||
120 | end | ||
121 | vim.b[buf].lazyvim_last_loc = true | ||
122 | local mark = vim.api.nvim_buf_get_mark(buf, '"') | ||
123 | local lcount = vim.api.nvim_buf_line_count(buf) | ||
124 | if mark[1] > 0 and mark[1] <= lcount then | ||
125 | pcall(vim.api.nvim_win_set_cursor, 0, mark) | ||
126 | end | ||
127 | end, | ||
128 | }) | ||
129 | |||
130 | -- close some filetypes with <q> | 112 | -- close some filetypes with <q> |
131 | vim.api.nvim_create_autocmd("FileType", { | 113 | vim.api.nvim_create_autocmd("FileType", { |
132 | group = augroup("close_with_q"), | 114 | group = augroup("close_with_q"), |