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 fileabcdefhijklmThis is a texton several linesand this is another lineLet'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 yThen I put my cursor on the o of the last lineFinally I put my letters before my cursor with PThe result I get is:This is a textaon several linesdand this is another linegjWhere as what I expected wasthis is a text adgjon several linesand this is another lineSo 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.
Insert a text selected via visual block
cut copy paste;visual mode;visual block
That plugin you're referring to might be my UnconditionalPaste plugin, which provides (among many related other commands) the exact glp (force linewise paste) command you're looking for here.As its author, I surely think the plugin provides very helpful functionality that warrants installing it, but you can achieve the same via a simple built-in command. After yanking, execute::call setreg('', '', 'ac')Then paste with P. This changes the type of the default register from blockwise to characterwise. (As there's no setregtype() function, it does this by appending (a) nothing ('') to the register.)The setreg() approach also works for other such conversions (e.g. characterwise to linewise with 'al' parameter.)For your particular example, there's an even shorter (but less general) way::put!will always paste in new lines.