Make Apple’s “vim” Command Paste Aware.

Since many people who have used the Mac are fairly new to UNIX, they’re rather nonplussed that many things “don’t work” for the unix underpinings as they do for the GUI.

Many of them are used to being able to cut and paste with Command-C, Command-P, but what if you’re not in insert mode?

The following snippit from my .vimrc shows how to use the external cut and paste programs (pbcopy/pbpaste) to use the clipboard.

map *y !pbcopyu map *p !l pbpaste

The first uses cmd-y (like vim’s control-y) to yank data into the clipboard; whereas command-p will paste the data into vim.