by champoradopapi · 3y ago · 0 comments
In visual mode, move a line up or down: vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
In normal mode, replace all occurences of the word under the cursor: vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
In normal or visual mode, Yank to the OS's pasteboard: vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
And there are plenty more that are related to specific plugins.
Also, I've remapped caps lock to esc in the OS. This makes it way easier to leave insert mode without leaving the home row.