2 ms·
Generally in vim, if you're pressing a key over and over, that's a smell that there's room for improvement there. In addition to counting motions, other great
by dllthomas 12y ago
Generally in vim, if you're pressing a key over and over, that's a smell that there's room for improvement there.
In addition to counting motions, other great options for getting around include:
% jump to the matching brace/bracket/paren
( jump back a "sentence"
) jump forward a "sentence"
{ jump back a "paragraph"
} jump forward a "paragraph"
Also, getting around by searching can be hugely worthwhile.
- rbonvall 12y agoAlso: n jump to the next occurrence of the last search N " " " previous " " " " " " * jump to the next occurrence of the word under cursor # " " " previous " " " " " "
- dllthomas 12y agoYes! Also, ^R^W (ctrl-r, ctrl-w) when you're at the : prompt will drop in the current word under the cursor. Which is also quite useful in keybindings.
- Anthony-G 12y agoThanks. That's a great tip. I've always yanked the word that I wanted and then used Ctrl-R" to paste it on Vim's command line. This is much better. I'm now off to read "cmdline.txt" (:help Command-line). BTW, I just accidentally closed my browser tab (latest version of Firefox) by hitting Ctrl-W when I wanted to delete the previous word in this textbox. That used to drive me mad but when Firefox restored the tab, it also restored the text I'd typed. :)