News for hackers. Stuff that matters.
Re:Pasting in command line Vim doesn't have to suck by graywh on Tuesday May 10, 2011 @10:06AM (#2532516)
When the author says "command line Vim" he means "Vim running in a terminal emulator".

And pasting to terminal Vim doesn't suck if your Vim is configured to detect mouse clicks or interface with the system clipboard. Using the system paste shortcut (command- or ctrl-V) in insert mode is not the way to do it.

Re:Pasting in command line Vim doesn't have to suck by zosi on Tuesday May 10, 2011 @10:22AM (#2532565)
Unless, of course, the system clipboard is on a different machine than the running copy of Vim. This is useful advice, you really don't have to be so negative about it just because you aren't in a situation where it's applicable.
Re:Pasting in command line Vim doesn't have to suck by pyre on Tuesday May 10, 2011 @11:01AM (#2532693)
If your ssh session has X11 forwarding enabled, and the remote terminal Vim has +xclipboard support, then you can use the "+P keystroke to paste directly from the clipboard into Vim.
Re:Pasting in command line Vim doesn't have to suck by burgerbrain on Tuesday May 10, 2011 @10:21AM (#2532564)

  :set pastetoggle=<F5>
Wack F5, middle-click paste away.
Re:Pasting in command line Vim doesn't have to suck by joefiorini on Tuesday May 10, 2011 @10:24AM (#2532571)
Sure, that works great if you want to reach for the mouse.
Re:Pasting in command line Vim doesn't have to suck by irahul on Tuesday May 10, 2011 @11:11AM (#2532725)
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.

Re:Pasting in command line Vim doesn't have to suck by burgerbrain on Tuesday May 10, 2011 @11:15AM (#2532740)
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.

Re:Pasting in command line Vim doesn't have to suck by jrockway on Tuesday May 10, 2011 @10:59AM (#2532684)
Pretty sure vi does not care about, or is even able to detect, the difference between a middle-mouse and a shift-insert paste.
Re:Pasting in command line Vim doesn't have to suck by pyre on Tuesday May 10, 2011 @11:02AM (#2532699)
Unless your terminal emulator has mouse support and you ':set mouse=a' in Vim.
Re:Pasting in command line Vim doesn't have to suck by jdj on Tuesday May 10, 2011 @01:29PM (#2533344)
Or you can use shift+insert.
Re:Pasting in command line Vim doesn't have to suck by joefiorini on Tuesday May 10, 2011 @10:25AM (#2532573)
Good point on my wording, thank you. I will change that to make it less confusing. As for middle-click, I really don't want to use the mouse. I don't use it for pasting anywhere else, so why would I change that for Vim?
Re:Pasting in command line Vim doesn't have to suck by Leynos on Tuesday May 10, 2011 @10:21AM (#2532562)
Although if you're using Vim over SSH from a Windows box, the :set paste command is useful to know.