Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste multiple times

Tags:

vim

copy

paste

What is the best way replace multiple lines with the contents of the clipboard?

The problem I'm having is when I yank a line and paste it over another line the "yank" is replaced with the line I just replace. Now, if I want to replace another line with the same line I have to go back up and yank it again.

There's got to be a better way to do this.

like image 861
jwerre Avatar asked Aug 23 '11 15:08

jwerre


People also ask

Can you paste multiple times in Excel?

Also, you may hold the ctrl key first before doing the ctrl + v in order to paste the copied items multiple times. Hope this helps you. Was this reply helpful?

What is the paste multiple?

By allowing you to select multiple content and paste all of them at once. Features: Filter you clipboard, to quickly find what to paste. Choose in which order you want to paste (older first or recent first)

How do I get multiple paste options?

Press Win key+V. Click the item you wish to paste. Continue until you've pasted each of the items you want. Next, you can control the items you've pasted.


1 Answers

I have this in my .vimrc:

xnoremap p pgvy 

(note: this will work only with the default register, but this mapping is easy to remember). Writing a more elaborate version would be possible. Also, you still can use P to get the old behaviour.

like image 133
Benoit Avatar answered Sep 30 '22 08:09

Benoit