How do I repeat an edit on multiple lines in Vim?

Ctrlv enters visual mode blockwise. You can then move (hjkl-wise, as normal), and if you want to insert something on multiple lines, use Shifti.

So for the text:

abc123abc
def456def
ghi789ghi

if you hit Ctrlv with your cursor over the 1, hit j twice to go down two columns, then Shifti,ESC , your text would look like this:

abc,123abc
def,456def
ghi,789ghi

(the multi-line insert has a little lag, and won’t render until AFTER you hit ESC).

Leave a Comment