On 6/07/12 5:29 AM, Penny Leach wrote:
Hi there,

I found the fix for the zsh problem in the troubleshooting page on the
wiki and it works perfectly for me if I launch macvim in any sort of
ordinary way.  However, I'm using the external editor plugin for
Thunderbird, and when it launches macvim, the PATH variable is not set
properly.

The launch command for the thunderbird plugin is: /Applications/
MacVim.app/Contents/MacOS/Vim -g --nofork

I don't see any good reason for this to cause the zsh variables to not
be read, any insight would be appreciated.

Thanks,
Penny

This doesn't work because starting a MacVim instance using the Vim
executable directly, or the mvim script, inherits the environment of the
caller. It doesn't go through the login shell like when using the New
Window menu command inside MacVim.

I get around this by means of a wrapper script that runs MacVim in a
login shell. My script is /Users/ben/bin/loginvim:

#!/bin/bash -l
/usr/local/bin/mvim "$@"

mvim is from the MacVim distribution, but installed to /usr/local.

Notice the -l argument to bash on the shebang line makes bash act as a
login shell when the script is executed and it therefore sources all the
relevant login scripts, like in Terminal.app or MacVim's New Window menu
command.

I then have Thunderbird's External Editor extension set to execute
/Users/ben/bin/loginvim -f and it works just fine.

After a bit of experimentation, I think the following will work for zsh.
It's a bit nasty (shells everywhere) but login was crashing when I used
it in a shebang line, so I had to do this:

#!/bin/sh
/usr/bin/login -f "$USER" /bin/zsh /usr/local/bin/mvim "$@"

You or someone else might know of some other magic, though. I'm not
really familiar with zsh, so I'm just feeling my way around.

Cheers,

Ben.



--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to