diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 12d606bd..fe07fc6f 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -39,6 +39,13 @@ map("n", "N", "Nzzzv") map("n", "", "_", { desc = "First character of Line" }) map("n", "", "$", { desc = "Last character of Line" }) +-- Copy whole file content to clipboard with C-y +map("n", "", ":%y+") + +-- 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("n", "dd", function() local is_empty_line = vim.api.nvim_get_current_line():match("^%s*$") if is_empty_line then