OSX: Environment variables pointing to application bundles?
Asked Answered
S

4

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?

Saros answered 9/1, 2009 at 11:58 Comment(0)
G
11

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.

Gunmaker answered 13/2, 2009 at 16:41 Comment(2)
Note the -f, which is the --no-fork flag. That's key.Gunmaker
Thanks for this answer, I used EDITOR="vim" for git, but that kept breaking. This "mvim -f" works perfectly!Sophiesophism
H
0

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

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

Hedvige answered 9/1, 2009 at 12:36 Comment(0)
S
0

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?

Sevilla answered 9/1, 2009 at 16:51 Comment(0)
B
0

<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>

Baty answered 8/4, 2009 at 18:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.