Posted in September 2013

Vim in OS X with System Clipboard Support

I’m currently in the process of trying to migrate from MacVim to a terminal based version of Vim on OS X. There are several motivations for switch (which I won’t go into here), but one of the frustrations I was encountering was lack of a functional asterix or ‘*’ register in Vim, which according to ‘:help registers’, is ‘… for storing and retrieving the selected text for the GUI.’

Solution 1: MacVim’s bundled Vim

One solution to this problem is to use the version of Vim that comes bundled with MacVim. For my version of OS X (Mountain Lion) and MacVim (Snapshot 65) this was possible by setting the following alias:

alias vim=/Applications/

Solution 2: Homebrew installed Vim

While the MacVim solution fixed my clipboard problems, I felt a little dirty using MacVim’s version of Vim. Looking around I found an alternative solution; installing the homebrew version of Vim. This assumes you already have homebrew installed (if not, see homebrew’s homepage.)

brew install vim

Hopefully one of those solutions works for you if you were struggling with the same problem.