0

Say I have a text file:

abc
abc
abc

I want to change it to this:

adbc
adbc
adbc

My current way of doing this is to move the cursor to the b in the first (or last) line, select the column of bs with Ctrl+v, 2j change it with c and type d.

But this means I also have to reenter the b which was deleted. It would be much nicer to insert at this point instead of changing, but i does not seem to work in visual block mode.

Is there a way of doing this – that is, without having to delete a character?

1

1 Answer 1

3

The answer is: after selecting in visual mode, use I to insert before the selection, and use A to insert after it.

Thanks a lot @Christian Brabandt!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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