diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index a6afe95..3b8e52e 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -11,7 +11,7 @@ vim.keymap.set({ "n", "v" }, "", }) vim.g.mapleader = " " --- Dealing with word wrap +-- dealing with word wrap vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { @@ -27,21 +27,36 @@ vim.keymap.set("n", "j", desc = "Smart down motion" }) -vim.keymap.set("n", "y", +-- yank and pasting +vim.keymap.set({ "n", "x" }, "y", "\"+y", { desc = "Yank to clipboard"} ) vim.keymap.set("n", "p", "\"+P", - { desc = "Copy from clipboard"} + { desc = "Paste from clipboard" } ) +vim.keymap.set("x", "p", + "\"_dP", + { desc = "Send selection to void register and paste from clipboard" } +) + +-- deletion +vim.keymap.set({ "n", "x" }, "d", + "\"_d", + { desc = "Send selection to void register" } +) + +-- comfort zone vim.keymap.set("n", "", "w! | !compiler %", - { desc = "Compile current file using ~/.local/bin/compiler"} + { desc = "Compile current file using ~/.local/bin/compiler" } ) + +-- packer vim.keymap.set("n", "u", function() require("packer").sync() end, - { desc = "Sync packer config and update plugins"} + { desc = "Sync packer config and update plugins" } ) -- telescope @@ -77,4 +92,6 @@ vim.keymap.set("n", "s", ) -- snippets -vim.keymap.set({ "i", "s" }, "", "luasnip-next-choice") +vim.keymap.set({ "i", "s" }, "", "luasnip-next-choice", + { desc = "Cycle through luasnip choices" } +)