3 ms·
My Vim experience got much better when I added this to my config: vim.keymap.set("n", "<leader>sr", ":%s//") It search-and-replaces all occurrences of the
by behnamoh 4y ago
My Vim experience got much better when I added this to my config:
vim.keymap.set("n", "<leader>sr", ":%s//")
It search-and-replaces all occurrences of the word under the cursor.
I also added the following to remove the highlights that appear (e.g., when pressing *):
vim.cmd("nnoremap <silent> <c-c> :nohl<CR><C-l>")
- Graziano_M 4y agoTry mapping it to `:set hlsearch!`. That way you can use the same mapping to toggle it on and off as you wish. EDIT: Also, you can use vim.keymap.set, no need for a vim command, just `vim.keymap.set("n", "<c-c>", "<cmd>set hlsearch!<CR>", {silent = true})`