[vim] Vim: How to insert in visual block mode?

How can you insert when you are in visual block mode (by pressing ctrl-V) in Vim?

This question is related to vim

The answer is


if you want to add new text before or after the selected colum:

  • press ctrl+v
  • select columns
  • press shift+i
  • write your text
  • press esc
  • press "jj"

You might also have a use case where you want to delete a block of text and replace it .

Like this

Hello World
Hello World

You can visual block select before "W" and hit Shift+i - Type "Cool" - Hit ESC and then delete "World" by visual block selection .

Alternatively, the cooler way to do it is to just visual block select "World" in both lines. Type c for change. Now you are in the insert mode. Insert the stuff you want and hit ESC. Both gets reflected with lesser keystrokes.

Hello Cool 
Hello Cool

  1. press ctrl and v // start select
  2. press shift and i // then type in any text
  3. press esc esc // press esc twice