2 ms·
> "Also what do you mean by, "learned as a language" wrt to vim keybindings?" Vim isn't a hodgepodge of ad-hoc keyboard shortcuts like, say, typical Windows pr
by jodrellblank 3y ago
> "Also what do you mean by, "learned as a language" wrt to vim keybindings?"
Vim isn't a hodgepodge of ad-hoc keyboard shortcuts like, say, typical Windows programs ("where shall we put search and replace? Ctrl+H is free, done"). It can be seen more as a small domain-specific language for text manipulation. "d2w" is delete twice word (delete two words). "yy4p" is copy line 4x paste (copy this line four times below).
It's built of verbs (or operators, like delete, yank, make-uppercase), counts, movements (motions, like up,down,to end of line, to end of word, to start of next word, to search match) and objects (like characters, words, lines, paragraphs, blocks inside braces, text inside quotes, 'the selection') and you compose them together to say what editing you want to do on the text.
":help gU" will tell you that gU makes {motion} uppercase, that means you can do gUe to uppercase to the end of the current word, gU2e to uppercase to the end of the next word, gUfx to uppercase until the next x character, gU/thing to uppercase until the regex search for 'thing' matches...
and Vim being around a long time, it has a lot of different verbs, motions, objects to allow you to slice and dice your text just so for the edits you want to make.
Try
:help motion
:help word-motions
:help operator
:help objects
- dleink 3y agoah yes, I am decent Vim user but hadn't thought about it in that context. Thanks for the context!