Copy to Mac OS X Clipboard from Vim
Here’s a short, but nifty, addition to your ~/.vimrc that’ll make copying to your Mac’s clipboard a little easier:
map cc :w !pbcopy
Typing ‘cc’ in command mode will put the entire current buffer into the clipboard. If you type ‘cc’ while you have lines selected in visual mode, it’ll only copy those lines.
Woo!
Advertisement