3 ms·
Yes, and here's my favorite vim trick I ever invented - you can do use this after changing a word. What I mean is: if I'm on a (say) a variable name, and I cha
by edanm 6y ago
Yes, and here's my favorite vim trick I ever invented - you can do use this after changing a word.
What I mean is: if I'm on a (say) a variable name, and I change it with "cw", then realize I actually need to change it in a few more places, I can use a little shortcut to change it in those places, without even thinking of it beforehand.
The shortcut is:
" Make <leader>. repeat the last "change word" command.
nnoremap <leader>. :let @/=@"<cr>/<cr>cgn<c-r>.<esc>
After any change command, just hit <leader>. to repeat it. You can thereafter hit "." to repeat again.