From d7ec4954a4f901a46e71af633b6bc99a3782873a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 30 Nov 2023 01:23:23 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20added=20new=20keymaps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit copying the whole content of the file and deleting a line without copying its contents --- .config/nvim/lua/config/keymaps.lua | 7 +++++++ 1 file changed, 7 insertions(+) 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