After switching to the Mac, I had one big itch that spoiled all the bliss: MacVim sometimes simply refused to cooperate with the system clipboard. As you can imagine, an editor that can’t exchange text with other software is a rather painful thing.

It’s especially painful when using set clipboard=unnamed – which you should, as it makes vim use the pasteboard as the default register – because you lose simple yanking/pasting and have to explicitly select a register before each operation.

Otherwise, you’ll just get a:

E353: Nothing in register *

I googled, asked on IRC and disabled my voluminous .vimrc, to no avail. I seemed to be the only person in the universe with that problem. Later on I was able to narrow it down: pbcopy and pbpaste – two super useful tools to interact from the command line with the clipboard – didn’t work too. But just like vim: only sometimes.

I started to question my sanity until my Google-fu finally revealed the tmux-MacOSX-pasteboard project and everything fell into place.

The “sometimes” – but most of the time, unfortunately – I had my problems was when MacVim was started from a tmux.

The project page explains the problem in detail but put simply: tmux doesn’t play nice with the pasteboard.

So if you run into problems like broken copy & paste, YankRing complaining that register “*” is empty or pbcopy/pbpaste apparently doing nothing, the solution is the aforementioned project or just not using tmux on the Mac.