Saturday, June 23, 2012

$PATH is different in Vim that in parent shell

I'm finding that $PATH is different in Vim than in the parent shell.
In a shell I see that $PATH reflects what's in my ~/.zshrc :

% echo $SHELL
/bin/zsh
% echo $PATH
/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/sbin:/usr/bin:\
/home/john/bin:/home/john/git/scripts:/home/john/.cabal/bin:\
/home/john/context/tex/texmf-linux/bin

But within a Vim session launched in that same terminal:

:!echo $SHELL
/bin/zsh
:!echo $PATH
/home/john/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:\
/usr/bin:/usr/sbin:/usr/NX/bin

... $PATH is different. So when using a shell script located in
/home/john/git/scripts in a mapping in my vimrc, it's necessary to
write out the full path to the executable. Seems this should be
easy to figure out, but searching around I can't come up with an
explanation as to why $PATH is different in Vim.

Thanks for any help,

John

--
John Magolske
http://B79.net/contact

--
You received this message from the "vim_use" 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

No comments: