News for hackers. Stuff that matters.
Re:Pasting Text Into Vim by kevinburke on Thursday July 26, 2012 @01:58AM (#4294627)
You can also yank from Vim to the system clipboard with

    "+y
Took me a year or so to learn that one
Re:Pasting Text Into Vim by srijan4 on Thursday July 26, 2012 @02:12AM (#4294664)
Or, you can add this to your vimrc to always yank to system clipboard:

    set clipboard+=unnamed
Re:Pasting Text Into Vim by LauriL on Thursday July 26, 2012 @12:35PM (#4296893)
A very helpful setting. Thanks!

I've been using the "+ register intensively. Your tip will save me from quite a lot of keystrokes in the future.

Re:Pasting Text Into Vim by AjithAntony on Thursday July 26, 2012 @04:51AM (#4295059)
FWIW, The + and * registers appear to behave the same on gvim for windows. I think * is actually expected to represent the system clipboard.

  :help clipboard
Also another AWESOME tip , if you set an "a" among your guioptions, your visual selects and mouse selects automatically get copied to the * register.

  : help quotestar
I realize that X environments mainly do this already, but not the visual select. Most of my editing is through SSH so I don't get to use the gui features much. The only time I use gvim is in windows, so it was pretty revolutionary for me.
Re:Pasting Text Into Vim by lloeki on Thursday July 26, 2012 @03:06AM (#4294791)
Of course it only works for non-terminal vim. Someone may make it work on Mac though by leveraging pb{copy,paste} in some clever way (can't remember the X11 equivalent ATM)
Re:Pasting Text Into Vim by natedub on Thursday July 26, 2012 @03:24AM (#4294845)
It can work in terminal vim, too.

I believe the special + register for the system clipboard is enabled by a compile option, but that may not be entirely accurate. I have Vim 7.3 installed via Macports and it works for me.

Re:Pasting Text Into Vim by mhd on Thursday July 26, 2012 @07:54AM (#4295521)
Yes, it's the "+clipboard" option (as shown by :version). If you weren't doing macports (or brew) already, the downloadable MacVIM version does include a "Vim" binary that's usable on the commandline. Somewhere in /Applications/MacVIM.app/... (can't check at work). Just symlinking or simply setting `alias vim='<path_to_binary>` works perfectly.

[MacVim]: http://code.google.com/p/macvim/

Re:Pasting Text Into Vim by lloeki on Thursday July 26, 2012 @04:09AM (#4294964)
I use OSX default vim. That might explain things. I'll try

    brew install macvim --override-system-vim
to see if things improve.

EDIT: it works.

Re:Pasting Text Into Vim by threedaymonk on Thursday July 26, 2012 @09:58AM (#4295967)
The X11 equivalents are:

    pbcopy = xsel -bi
    pbpaste = xsel -b