Skip to content

Comment on Pasting in command line Vim doesn't have to suckparent

Comments

  :set pastetoggle=<F5>
Wack F5, middle-click paste away.

Sure, that works great if you want to reach for the mouse.

As mentioned elsewhere, if your vim is compiled with clipboard support(:version and look for +clipboard), you can copy/paste from the clipboard.

* is the Linux selection register.

+ is your clipboard.

So yanking is just set paste, "+y or " * y, set nopaste. Similarly you can do a "+d in vim and ctrl-v it in your browser or anywhere you can access the clipboard. You can " * d/" * y and paste it with your middle mouse button.

The mouse has nothing to do with it...

If you paste method doesn't let vim know what's going on, use pastetoggle, otherwise don't.

Pretty sure vi does not care about, or is even able to detect, the difference between a middle-mouse and a shift-insert paste.

Unless your terminal emulator has mouse support and you ':set mouse=a' in Vim.

Or you can use shift+insert.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.