Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to configure the $PATH env variable of vim's internal shell.

I have commands that update the $PATH several times during a session. I see that vim inherits my shell's first $PATH - but not updated $PATH variables.

Some things that might be helpful:

  • I open vim multiple times - with changes to $PATH in between
  • The internal shell does source cshrc every time I launch the internal shell
  • Sourcing cshrc on the main shell doesn't change $PATH

-- update So the problem is because the .cshrc file. It does some initial setting up where the path gets reset. Launching a new shell within the current shell resets $PATH. I'll have to figure out a way to go around this.

I'm using tcsh on a redhat machine. Any clue why this is happening and how to fix this?

share|improve this question
    
How do you start Vim – once per session, or every time? –  grawity Jun 13 '12 at 22:53
    
Multiple times - with changes to $PATH in between (when vim is closed). Maybe vim's internal shell sources .cshrc/etc? Could that reset the $PATH everytime? –  Utkarsh Sinha Jun 13 '12 at 22:54
1  
It could be that... echo "starting cshrc" is a good debugging tool, by the way. –  grawity Jun 13 '12 at 23:02
    
Hmm - it does source cshrc. But I tried sourcing it in the actual shell. It doesn't change $PATH there. –  Utkarsh Sinha Jun 13 '12 at 23:22
add comment

1 Answer 1

If you don't want your internall shell to source .cshrc, try passing an option to it, by setting shellcmdflag, e.g.:

set shellcmdflag=--norc

This will only affect the shell when using ! and :!. To affect also :shell use:

set shell=bash\ --norc

(of course replace that with your shell of choice and the correct option to skip reading the rc file).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.