diff options
| author | jdhao <jdhao@hotmail.com> | 2023-08-28 21:08:51 +0200 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2023-08-28 21:11:32 +0200 |
| commit | fc1c447319d2eca318c751d641f9ce8ce6a92005 (patch) | |
| tree | 493ccd64fd032f608b1e92311a137943b0122397 /lua/mappings.lua | |
| parent | 1391ca7ff153636476bae6ffbf16aec076e2d191 (diff) | |
fix multi-line yank issue, close #220
The previous way of keep the cursor while yanking is not perfect.
It will break multi-line yank (`{count}yy`).
Diffstat (limited to 'lua/mappings.lua')
| -rw-r--r-- | lua/mappings.lua | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/lua/mappings.lua b/lua/mappings.lua index 8a1e2e6..1853317 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -201,20 +201,6 @@ end -- insert semicolon in the end keymap.set("i", "<A-;>", "<Esc>miA;<Esc>`ii") --- Keep cursor position after yanking -keymap.set("n", "y", "myy") - -api.nvim_create_autocmd("TextYankPost", { - pattern = "*", - group = api.nvim_create_augroup("restore_after_yank", { clear = true }), - callback = function() - vim.cmd([[ - silent! normal! `y - silent! delmarks y - ]]) - end, -}) - -- Go to the beginning and end of current line in insert mode quickly keymap.set("i", "<C-A>", "<HOME>") keymap.set("i", "<C-E>", "<END>") |
