4 ms·
Vim has Motions, Commands, and Commands that affect Motions. Move-by-word is a motion: w Search is a motion: /foo Next match is a motion: n Delete is a comm
by ramses0 3y ago
Vim has Motions, Commands, and Commands that affect Motions.
Move-by-word is a motion: w
Search is a motion: /foo
Next match is a motion: n
Delete is a command that takes a motion:
* dw
* dn
* d/bar
...nearly ad-infinitum. (eg: numeric repetition is a command that takes a command or a motion: 3dw, 3j)
- cruffle_duffle 3y agoThat is probably one of the more helpful tips I’ve read about vim in a long while!
- ramses0 3y agoWould you like to know more? http://www.robertames.com/blog.cgi/entries/physics-of-vim.html http://www.robertames.com/blog.cgi/entries/physics-of-vim.ht...
- Izkata 3y ago> 3dw I can't say how they're implemented, but I think of repetitions as a distinct third thing, because this also works: d3w
- mst 3y agoYes and no? 3dw is 3(dw) is dw dw dw d3w is d(3w) is d(w w w) So the number is doing basically the same thing in both cases. (this is not a criticism of your mental model, jusst me musing)
- deleted 3y ago[deleted]