7

I was looking for a way to edit multiple line simultaneously.

I found that Ctrl-V + selecting the lines + I should be the solution. The problem is that, for me, after pressing I (in fact Shift-i) I'm switching to the classic single line insertion mode on the first line of my selection.

Why is that? Is there an option to set in my .vimrc?

I'm using vim 7.3 with the +visualextra option enabled (I saw somewhere it was required).

10

Have you tried it? Vim does not update all columns at once, only the first one. When you conclude the edit with Esc, all the other lines magically are filled with the same text.

Also note that on Windows, you often need to actually use <C-Q> instead of <C-V>, which is mapped to paste the clipboard.

Protip: In blockwise visual mode, you can also change text, or (if you extend the selection with $), Append with a non-aligned right text border.

  • Or replace text. – romainl Jan 22 '13 at 10:52
  • Ok, my bad, I was expecting to see the change on all the lines while typing. It's working fine. – gregseth Jan 22 '13 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.