From 1260a4957dc8755e2f5ac2417cc88ea177e60125 Mon Sep 17 00:00:00 2001 From: dpearre Date: Thu, 17 Oct 2024 14:25:36 -0700 Subject: [PATCH] Overwrite 'c' ('change') keybinding so it leaves yank register alone --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index 95a9186a..4dfca147 100644 --- a/init.lua +++ b/init.lua @@ -1217,6 +1217,11 @@ vim.diagnostic.config { vim.keymap.set('', 'l', require('lsp_lines').toggle, { desc = 'Toggle lsp_lines' }) +-- Redirect change operations to the blackhole to avoid spoiling 'y' register content +-- https://www.reddit.com/r/neovim/comments/13p5mq7/comment/jl824ti +vim.keymap.set('', 'c', '"_c') +vim.keymap.set('', 'C', '"_C') + -- You can link highlighting groups. -- This is the default (when colour scheme is unknown) -- Try with CursorColumn, Pmenu, Folded etc.