How to do column editing in vim?
To edit a column, follow these steps:
- Stand on the beginning of the column
- Press Ctrl+v, then mark across the column you want to edit.
- Press Shift+i to insert text at the beginning of the column, Shift+a to append text, r to replace highlighted text, d to delete, c to change... etc.
- Hit ESC when done.
I think people (me) sometimes map the column editing keys to Ctrl+Q so it won't collide with visual select line (V) or paste-text if you mapped it as such.
...I couldn't follow the steps of sa125 (facepalm) so I looked someplace else and found a simpler explanation at: https://blog.pivotal.io/labs/labs/column-edit-mode-in-vi
- Ctrl+v [ and select what ever you want]
- Shift+i [and write whatever...(check out ** below)]
- Esc
*c without Shift can be used instead of step 2, to delete selection before insert. And also r to replace.
**!! Attention Don't be discouraged by the fact that only the first row is changed when you 'write whatever...'!!
Hope it helps!