Here is the procedure I recommend, for those who are comfortable with the command-line and with Homebrew:
Install Homebrew.
Run the following on the command line (in Terminal):
brew install macvim --with-override-system-vim
brew linkapps
Edit your shell startup files to ensure that /usr/local/bin
comes first in your $PATH
.
If you use vim as $VISUAL
or $EDITOR
, add `export VISUAL='mvim -f' to your environment (details).
Check that you installed everything correctly by running
brew doctor
Now, you can run the graphical MacVim on a file by running mvim foo.txt
from the command-line. Or, you can run the text-based editor by running vim foo.txt
. Also, if other programs (e.g., git) fork off a separate editor, they'll run the graphical MacVim.
See also How to run mvim (MacVim) from Terminal? and Set macvim as default application after homebrew installation.