Home

Vim Tip: Text Object Selection

  • Feb. 20th, 2007 at 8:37 PM
EvilPHish evil fish shlomi fish

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:

  1. To indent the inside of a block (after a copy and paste for example) use >i} or <i}. It beats writing >% and then doing <<%<<
  2. To change a string use ci".
  3. To delete a block use da}.
  4. 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).

Latest Month

August 2008
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Tags