| Shlomi Fish ( @ 2007-02-20 20:37:00 |
| Current location: | Home |
| Current mood: | accomplished |
| Current music: | Yehud Poliker - Jacob's Ladder |
| Entry tags: | block, commands, editing, editors, grail, holy, motion, paragraph, selection, text, tip, vim |
Vim Tip: Text Object Selection
The Vim text editor has a set of selection commands for selecting various parts of the text while being inside them. Some of them are very useful - here are some examples:
- To indent the inside of a block (after a copy and paste for example) use >i} or <i}. It beats writing >% and then doing <<%<<
- To change a string use ci".
- To delete a block use da}.
- To copy a paragraph use yap.
Etc. Oh and try typing :he holy-grail in Vim (this tip courtesy of LeoNerd from Freenode who found it).