feat(nvim): added new keymaps

copying the whole content of the file and deleting a line without copying its contents
This commit is contained in:
Sergio Laín 2023-11-30 01:23:23 +01:00
parent e08e9f173e
commit d7ec4954a4
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -39,6 +39,13 @@ map("n", "N", "Nzzzv")
map("n", "<a-h>", "_", { desc = "First character of Line" }) map("n", "<a-h>", "_", { desc = "First character of Line" })
map("n", "<a-l>", "$", { desc = "Last character of Line" }) map("n", "<a-l>", "$", { desc = "Last character of Line" })
-- Copy whole file content to clipboard with C-y
map("n", "<C-c>", ":%y+<CR>")
-- 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() map("n", "dd", function()
local is_empty_line = vim.api.nvim_get_current_line():match("^%s*$") local is_empty_line = vim.api.nvim_get_current_line():match("^%s*$")
if is_empty_line then if is_empty_line then