Column Edit Mode in VI
I've found that typing in column mode to be very useful when using editors like IntelliJ or TextMate. VI also has a column edit mode, that is a little tricky to use.
To use it, press:
- Ctrl + V to go into column mode
- Select the columns and rows where you want to enter your text
- Shift + i to go into insert mode in column mode
- Type in the text you want to enter. Dont be discouraged by the fact that only the first row is changed.
- Esc to apply your change (or alternately Ctrl+c)
You will now see your changed applied.








you guys are so helpful. pivotal is the best
remove
Brian, can you give an example of where this capability (inserting the same thing in front of a number of lines) would be used?
For example, I could imagine using it to comment out some lines, but without "comment-in" capability, that wouldn't be helpful.
///ark
remove
Mark,
I use column edit mode for comments, mostly (since Ruby doesn't have block comments). After the 'shift-i' I just type "# " and ESC (or ctrl-c or ctrl-[)
It is also useful to indent a block of lines forward/back. There are other ways to deal with block indenting, but I tend to use column edit probably b/c I just haven't build muscle memory for the other methods.
remove
Garry,
Ruby does have block comments:
I've rarely seen them ever used though.
remove
Mark, If I understand you correctly, you can comment in by
remove
Also hitting "v" in VI will get you into Visual mode which is also very helpful if you need to change lines rather than blocks.
remove