From c9246017697d8b39270e903221a1a69dee7da599 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Sun, 18 Feb 2024 21:48:41 +0100 Subject: [PATCH] vim: visual mode paste without loosing yanked text --- config/nvim/lua/fschauen/keymap.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/nvim/lua/fschauen/keymap.lua b/config/nvim/lua/fschauen/keymap.lua index 42f9f7e..8daf38e 100644 --- a/config/nvim/lua/fschauen/keymap.lua +++ b/config/nvim/lua/fschauen/keymap.lua @@ -82,6 +82,9 @@ M.setup = function() -- quickly change background map('n', 'bg', [[let &background = &background ==? 'light' ? 'dark' : 'light']]) + -- don't loose the original yanked contents when pasting in visual mode + map('x', 'p', [["_dP]]) + local diagnostic = require 'fschauen.diagnostic' -- navigate diagnostics