Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

  • Blog Navigation
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

  • Mark Wilden

    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.


  • 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.

  • Garry,

    Ruby does have block comments:

    this is all
    commented out

    I’ve rarely seen them ever used though.

  • Brian Takita

    Mark, If I understand you correctly, you can comment in by
    * going into column select mode
    * selecting the block you want to delete
    * press x

  • 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.

  • Allen

    I have to press ‘esc’ twice, my changes to each line will be applied.

Share This