OSX: Environment variables pointing to application bundles?
-
06-07-2019 - |
Question
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?
Solution
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.
OTHER TIPS
Have you tried export EDITOR=/Applications/MacVim.app?
Or wrapping MacVim in a small script that uses open to start the app?
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?
<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>