I'm facing a behavior that I find unatural when trying to paste a block of text selected with visual block mode (<C-v>
): I can't insert it between two lines without messing with the already existing line.
Here's an example:
If I have this file
abc
def
hij
klm
This is a text
on several lines
and this is another line
Let's say I want to put the first letters of each of the 4 first lines between the 2 others lines of text.
- First I'll select the 4 letters:
<C-v> 3j y
- Then I put my cursor on the
o
of the last line - Finally I put my letters before my cursor with
P
The result I get is:
This is a text
aon several lines
dand this is another line
g
j
Where as what I expected was
this is a text
a
d
g
j
on several lines
and this is another line
So it means that each time I want to past a block this way I have to insert the corresponding number of empty lines before I past which is pretty unatural in my opinion.
I found a vim tip suggesting to use 1vp
to select a corresponding number of lines before pasting but that allows a replacement not an insertion of the block.
So my question is: What is the good way to insert a visually selecting block between two existing lines?
Also I once saw a plugin (which I can't remember the name) which "improved" visual block mode, but I'd like not to add a plugin just to enable this behavior.