Installing MacVim via Homebrew

Installing MacVim via Homebrew

One of the easiest way to install MacVim is via Homebrew. If you do not have Homebrew installed I highly recommend you install it. Just go to this site and follow the install instructions there.

Once you have home brew installed you should be able to run the command

$ brew install macvim

This will install and compile macvim if you have the appropriate dependencies installed. If your install completes then then you can stop right here and enjoy using macvim. However sometime you will be prompted with an error message asking you to install something or debug why it failed.

When I decided to install MacVim via Homebrew I was greeted with this lovely error message.

$ brew install macvim

==> Downloading

Already downloaded: /Library/Caches/Homebrew/macvim-7.4-73.tar.gz

==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 -

==> make Linked fine with a few libraries omitted

xcodebuild -project MacVim/MacVim.xcodeproj 

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

make[1]: *** [macvim] Error 1

make: *** [first] Error 2


These open issues may also help:

Macvim linked twice to Python and possible solution? (

macvim failed to build on 10.9 because of x11 (

The issue here was xcode's command line tools were not installed. If you do not have xcode already installed you will want to do so, its a very easy install via the mac app store.

Then you run this command.

$ xcode-select --install

Then you can feel free to try and brew install macvim. If it still fails you will want to run.

$ sudo xcode-select -switch /Applications/

Once that completes you should be able to run brew install macvim again. After that MacVim should compile on your machine and you’re ready to start vim-ing it up!