diff options
| author | Yigit Sever | 2025-01-17 10:13:02 +0100 |
|---|---|---|
| committer | Yigit Sever | 2025-01-17 10:13:02 +0100 |
| commit | 2d697c3ebe0e35a8e8fe39eeb9d8f8a59bf0e248 (patch) | |
| tree | 9ee0efd90bcfa450a4105520797f29673fd27d9c /.config/nvim/lua/helpers | |
| parent | 2dbc978b686ad11e88e7615099219032bb0a0817 (diff) | |
| download | dotfiles-2d697c3ebe0e35a8e8fe39eeb9d8f8a59bf0e248.tar.gz dotfiles-2d697c3ebe0e35a8e8fe39eeb9d8f8a59bf0e248.tar.bz2 dotfiles-2d697c3ebe0e35a8e8fe39eeb9d8f8a59bf0e248.zip | |
nvim: add lastplace plugin, remove autocmd
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"), |
