feat(nvim): add new keymaps for not yank when changing

This commit is contained in:
Sergio Laín 2024-01-02 11:09:31 +01:00
parent 06398683de
commit 4fd723b637
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
2 changed files with 7 additions and 3 deletions

View file

@ -66,9 +66,12 @@ map("n", "<C-c>", ":%y+<CR>", { desc = "Copy whole text to clipboard", silent =
-- Select all text
map("n", "<C-a>", "gg<S-V>G", { 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*$")

View file

@ -6,5 +6,6 @@ return {
extra_keymaps = true,
extended_keymaps = true,
override_keymaps = true,
default_delay = 3,
},
}