views:

2875

answers:

3

Apologies but I am new to the whole UNIX/Mac command line.

I have MacVim installed and I am trying to set it up as the editor for Git (version control). But I can't run 'mvim' from the command line as it isn't recognised. I don't see an option in MacVim to do this for me. I am guessing I need to edit a PATH variable on the Mac?

+15  A: 

There should be a script named mvim in the root of the .bz2 file. Copy this somewhere into your $PATH ( /usr/local/bin would be good ) and you should be sorted.

Gordon Robertson
+3  A: 

I'd seriously recommend installing MacVim via MacPorts (sudo port install MacVim).

When installed, MacPorts automatically updates your profile to include /opt/local/bin in your path, and so when mvim is installed as /opt/local/bin/mvim during the install of MacVim you'll find it ready to use straight away.

When you install the MacVim port the MacVim.app bundle is installed in /Applications/MacPorts for you too.

A good thing about going the MacPorts route is that you'll also be able to install git too (sudo port install git-core) and many many other ports. Highly recommended.

ianmjones
Thanks I'll give this a go. I installed MacVim and Git using the UI installers. But its looking like Macports is the way to go.
Jon
Don't use mac port versions unless you absolutely need to. It installs all the dependency libraries ignoring darwin native ones. This can i.e. replace your perl 5.10 with 5.8 in path etc. Check homebrew (brew) system instead.
Slava Nadvorny
+5  A: 

In addition, if you want to use MacVim as $EDITOR, you should be aware that by default MacVim will not wait for a return value, which will confuse your source control program. export EDITOR='mvim -f' should give you what you want.

-steve

hakamadare