From ad672effd499e6a1a0008632e68c83f5d64ee3df Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Sun, 1 Oct 2023 19:20:04 -0400 Subject: [PATCH] add visual mode keymaps to yank/put into register 'a' allow storing text into a named register so that it won't be lost when replacing selected text --- .config/nvim/lua/keymaps.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua index f8361ff..1e41076 100644 --- a/.config/nvim/lua/keymaps.lua +++ b/.config/nvim/lua/keymaps.lua @@ -48,9 +48,10 @@ vim.keymap.set("x", "d", "\"_d") -- copy/paste to/from system clipboard vim.keymap.set({ "n", "v" }, "y", "\"+y") --- pasting a selected/higlighted block of text should not replaced the content of the clipboard with it -vim.keymap.set({ "n", "v" }, "p", "_\"+p") -vim.keymap.set({ "n", "v" }, "p", "_p") +vim.keymap.set("n", "p", "\"+p") +-- yank/put to/from register 'a' +vim.keymap.set("x", "ay", '"ay', { noremap = true }) +vim.keymap.set("x", "ap", '"ap', { noremap = true }) -- increment/decrement a count, helpful for changing indeces vim.keymap.set("n", "+", "")