From fc1c447319d2eca318c751d641f9ce8ce6a92005 Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 28 Aug 2023 21:08:51 +0200 Subject: 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`). --- lua/mappings.lua | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'lua/mappings.lua') 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", "", "miA;`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", "", "") keymap.set("i", "", "") -- cgit v1.2.3