Vim: edit multiple lines
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).
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 c
hange text, or (if you extend the selection with $
), A
ppend with a non-aligned right text border.