Mercurial Vim-ness on Mac OS X


Vim 7.3.161

Vim is better than Emacs.

Homebrew laying it down

Unlike some other package managers, Homebrew attempts to use Mac OS X’s default userland software where it can. While most of the time this is advantageous (DRY but for software), it also means sometimes you’re stuck with a prior version until Apple decides to update, such as Vim.

% brew search vim
==> macvim vimpager
==> If you meant `vim’ precisely:
==> Apple distributes vim with OS X, you can find it in /usr/bin.

I've reviewed MacVim here before and like it very much, but often I prefer not having to leave the terminal for certain tasks. Also, (at the time of writing this) the version of Vim bundled with Snow Leopard is 7.2.108 (over six months old), whereas the latest version is 7.3.161 which fixes several critical issues and adds features.

Fortunately, I went against the Homebrew developer's advice (Playing with Homebrew on Mac OS X) and installed it in /opt/local, leaving /usr/local for software I build myself!

Grabbing the source, building, etc

The easist way to install and keep Vim current is using Mercurial which Vim's developers have recenty swtiched to using, very cool! Of course you'll need Mercurial first, and using the Python easy_install system is (IMHO) the easiest way to get it in OS X. Its right there in the name!

# easy_install Mercurial

As I said, I build my own stuff in /usr/local/, so I clone the Vim source into that, then build it. Mac OS X doesn't come with a /usr/local/ tree by default, so you may need to create that first.

# mkdir -p /usr/local/src
# cd /usr/local/src
# hg clone vim
# cd vim
# ./configure
# make install clean

And budda-boom! The editor that's better than Emacs. I would know, because I'm using a Mac Pro that doesn't have a built in CRT. See what I did there? The Bird is The Vim.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.