Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to paste before the cursor after selecting a vertical block?

I'm so sure that this must exist, but if it doesn't maybe there is a macro for it...

One of my most favourite features of vim is the insert before when in visual mode (<C-v>, select the lines, <C-I>, type a little, then Esc).

My issue is that I want to paste the clipboard contents before, not 'insert'. I tried <C-P> but no love.

I have read cheat sheets, searched everywhere, looked through the questions on here and haven't found it, but I could definitely be searching for the wrong thing.

like image 760
Christian Avatar asked Nov 01 '10 22:11

Christian


People also ask

How do you paste into a visual block?

Pasting over a block of text You can copy a block of text by pressing Ctrl-v (or Ctrl-q if you use Ctrl-v for paste), then moving the cursor to select, and pressing y to yank. Now you can move elsewhere and press p to paste the text after the cursor (or P to paste before).


1 Answers

Generally, the P command (upper case, different from p) pastes the contents of the clipboard before the cursor position. Is that what you're looking for? (I'm not quite sure what you mean when you say you press Command+I, as my keyboard doesn't have a Command key.)

like image 185
Greg Hewgill Avatar answered Sep 21 '22 19:09

Greg Hewgill