Here is the procedure I recommend, for those who are comfortable with the command-line and with Homebrew:
Run the following on the command line (in Terminal):
brew install macvim --override-system-vim
Edit your shell startup files to ensure that
/usr/local/bin comes first in your
If you use vim as
$EDITOR, add `export VISUAL='mvim -f' to your environment (details).
Check that you installed everything correctly by running
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.