Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual block insert/append doesn't work

Tags:

vim

I select a block of text using Ctrl-V, but when I then type Shift-A or Shift-I, my vim editor goes into insert mode on only the location where I began the visual block mode.

For example,

Here is  text 

I want

#Her  #is  #text 

but I get:

#Here is  text 
like image 211
Rose Perrone Avatar asked Feb 17 '13 20:02

Rose Perrone


2 Answers

Make sure you exit visual block with ESC, not Ctrl C.

Also, Vim does not live update in visual block mode, you have to leave visual block mode to show the changes on other lines.

You will only see:

#Here is  text 

After you enter visual block and insert a #, but once you leave visual block mode pressing ESC it should look like:

#Here #is  #text 
like image 68
Tom Cammann Avatar answered Sep 21 '22 05:09

Tom Cammann


Ctrl-V-> select the block -> press I -> type #

then press ESC

more detail:

:h v_b_I 

you can see:

Visual-block Insert                     *v_b_I*   With a blockwise selection, I{string}<ESC> will insert {string} at the start  of block on every line of the block, provided that the line extends into the block.  
like image 29
Kent Avatar answered Sep 21 '22 05:09

Kent