Bash Commands from vim

When I run bash commands from within vim, I notice that the path is wrong. Is there a way inside my .vimrc that it loads my .bash_profile or just inherits the PATH and alias settings from the terminal from which it started?

+5
source share
2 answers

if you define the shell as interactive, vim will load your .bashrc or .bash_profile. By default, it is not loaded.

It can be done:

:set shellcmdflag=-ic  

The default is only used -c, :h shellcmdflagto see the details. Of course you can add it to your .vimrc file.

+6
source

export PATH , Vim PATH. :echo $PATH Vim, :let $PATH .= ':/additional/path'.

, Kent. : 'shellcmdflag' ( ) Vim.

+2

All Articles