From 4fd723b637417811d201c3bc96b716106a8c2819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Tue, 2 Jan 2024 11:09:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20add=20new=20keymaps?= =?UTF-8?q?=20for=20not=20yank=20when=20changing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/config/keymaps.lua | 9 ++++++--- .config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index a98c0b50..a4b6b9fc 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -66,9 +66,12 @@ map("n", "", ":%y+", { desc = "Copy whole text to clipboard", silent = -- Select all text map("n", "", "ggG", { desc = "Select all text", silent = true, noremap = true }) --- Better paste --- remap "p" in visual mode to delete the highlighted text without overwriting your yanked/copied text, and then paste the content from the unnamed register. -map("v", "p", '"_dP') +map("v", "p", '"_dP', { desc = "Paste without overwriting" }) + +map("n", "c", '"_c', { desc = "Change without yanking" }) +map("n", "C", '"_C', { desc = "Change without yanking" }) +map("x", "c", '"_c', { desc = "Change without yanking" }) +map("x", "C", '"_C', { desc = "Change without yanking" }) map("n", "dd", function() local is_empty_line = vim.api.nvim_get_current_line():match("^%s*$") diff --git a/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua b/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua index c7de3f3d..677fe292 100644 --- a/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua +++ b/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua @@ -6,5 +6,6 @@ return { extra_keymaps = true, extended_keymaps = true, override_keymaps = true, + default_delay = 3, }, }