I have an area selected in Vim. How can I copy it into the OS X clipboard?
(The OS X clipboard can be written to via a pipe to /usr/bin/pbcopy
)
For MacVim and Windows Gvim, simply add the following to your ~/.vimrc
:
set clipboard=unnamed
Now all operations such as yy
, D
, and P
work with the clipboard. No need to prefix them with "*
or "+
.