Skip to content
Bjorn Winckler edited this page Dec 12, 2012 · 15 revisions

How to get the MacVim source code

Open up Terminal and type (this requires that you have Git installed):

$ git clone git://github.com/b4winckler/macvim.git

(If you do not have Git installed the "Zip" button under the "Code" tab lets you download an archive containing the source code.)

How to build MacVim

First clone the repo as above, then configure with the flags you want, e.g.:

$ cd macvim/src
$ ./configure --with-features=huge \
              --enable-rubyinterp \
              --enable-pythoninterp \
              --enable-perlinterp \
              --enable-cscope

Note: As of Mac OS X 10.7 (Lion) and 10.8 (Mountain Lion) you must set the environment variable CC=clang before calling configure, e.g. type CC=clang ./configure and then add any flags to configure. For Xcode 4.5+ on OS X 10.7 (Lion), you'll also need to set CC=clang before calling configure. (If you want to build with clang on earlier platforms then you have to switch vim/MacVim/MacVim.xcodeproj to clang too, else IPC between backend and gui won't work.)

Once this has finished, build the project:

$ make

The resulting app bundle will reside under MacVim/build/Release. To try it out quickly, type:

$ open MacVim/build/Release/MacVim.app

To install MacVim, type

$ open MacVim/build/Release

and drag the MacVim icon into your Applications folder.

Enabling extra features

You can enable extra Vim features by passing the appropriate flags to configure. These are the parameters to configure you are most likely to want to enable:

  • All standard features: --with-features=huge
  • Cscope support: --enable-cscope
  • Python interpreter: --enable-pythoninterp
  • Ruby interpreter: --enable-rubyinterp
  • Perl interpreter: --enable-perlinterp
  • Universal binary: --with-macarchs=ARCHS (ARCHS=x86_64,i386,ppc,.., one or more items in quotation marks separated by spaces)
  • Mac OS X SDK version: --with-macsdk=VER (VER=10.4,10.5,10.6,..)
  • Your email address: --with-compiledby=someone@example.com

To see all available flags, type ./configure --help.

Notes on document icons

Each file type associated with MacVim has an icon representing it. This is called a document icon. By default MacVim uses a generic document icon for all file types, but it is possible to generate individual document icons for each associated file type.

To build document icons (assuming the cwd is the src/ directory):

$ cd MacVim/icons
$ make getenvy
$ make all

The make getenvy step is optional and requires an internet connection. This step downloads the Envy Code R font which is then used to generate the 16x16 icons to make them more legible. (The official build of MacVim uses the Envy Code R font.)

It is also possible to download document icons and unpack them to src/MacVim/icons if the automatic generation fails for some reason.

Note that document icons must be generated (or downloaded) before building MacVim!

Clone this wiki locally