Visual block edit in vim

I just implemented sid-m's answer here, show the result here. For there are few users also encounter this issue.

After pressed I:

enter image description here

Entered aaa: (Don't misslead by the status which is same with normal insert by pressing i here)

enter image description here

Entered Esc.

enter image description here


After pressing I in visual block mode, vim appears to have entered insert mode. But when you exit the insert mode and go to normal mode again, you will see that the keys you pressed in insert mode have taken effect in the entire selected block.

A demo is available at this link


Visual-block mode

Inserting text before the selection

Step 1, create your visual-block selection with:

<C-v>{motion}

Step 2, enter insert mode with I:

I

Step 3, insert what you want:

foo

Step 4, leave insert mode:

<Esc>

Inserting text after the selection

Step 2, enter insert mode with A:

A

Changing the content of the selection

Step 2, cut and enter insert mode with c:

c

Replace the content of the selection with the same character

Step 2, press r:

r

Step 3, press the desired key:

-

Try a little harder next time.