views:

1129

answers:

5

I want cscope to open files in MacVim instead of vim, so I'm trying to have the path to MacVim as the Value of the EDITOR environment variable which is used by cscope:

$ export EDITOR=/Applications/MacVim.app/Contents/MacOS/MacVim

If I'm now trying to edit a file from within ctags, it won't work and throws this error message:

$ MacVim[8384:10b] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting

Calling MacVim from the commandline with

$ /Applications/MacVim.app/Contents/MacOS/MacVim

works, though.

How can I fix this?

A: 

Have you tried export EDITOR=/Applications/MacVim.app?

Or wrapping MacVim in a small script that uses open to start the app?

frankodwyer
A: 

It works fine for me when I set my EXPORT variable to exactly that, and start a git commit. What are you using that's calling it? Have you considered setting EXPORT to point to the mvim script that comes on the MacVim disk image instead?

Tony
+1  A: 

Pointing EDITOR to the mvim script worked. I found it at /usr/local/bin/mvim. But I still wonder what to do if I would like to point it to an app that provides no script. Just write a new one every time? Seems annoying...

Benjamin Buch
+6  A: 

Make sure you put the mvim script in your path, and try this out:

export EDITOR="mvim -f"

This was the ticket for me when using MacVim as editing git commit messages.

Jim Garvin
Note the -f, which is the --no-fork flag. That's key.
Jim Garvin
Thanks for this answer, I used EDITOR="vim" for git, but that kept breaking. This "mvim -f" works perfectly!
Tom Lokhorst
A: 

<plug>

My launch tool is designed for this. It's like Apple's open, but allows you to get the path to an application bundle rather than launching it. For example:

% launch -ni com.apple.safari
/Applications/Safari.app

launch is in Fink and MacPorts too.

</plug>

Nicholas Riley