[Periodically VIM is my regular VIM tips and discoveries section, inspired by what was Daily VIM]
The Tip: iw can be used either in Visual Mode or after an operator to select or perform an operation on the entire word, regardless of where your cursor is within the word.
Usage: For visual mode, place your cursor on a word and hit the keystrokes viw or just iw if you were already in visual mode and selecting a block of text. For other commands, just place your cursor on a word and use the keystrokes Xiw, where X in this case is the operation you want. E.g.: diw deletes the word your cursor is presently under.
What Is It Good For?: Save yourself some of the keystrokes you'd make hitting h and l to move to the beginning of the word before performing an operation on it and just type your operation followed by iw.
0 comments:
Post a Comment