Why does my vim command-line path differ from my shell PATH?

后端 未结 4 630
北恋
北恋 2021-02-08 02:37

e.g.,

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/bin:~/bin:/usr/local/Cellar/python3/3.2.3/bin

$ vim 
:! echo $PATH
/usr/bin:/bin         


        
4条回答
  •  半阙折子戏
    2021-02-08 03:23

    There are many similar questions on stackoverflow and stackexchange.

    Your shell executes different *rc files depending on the arguments its given at launch time. Therefore, you need to setup Vim so that it launchs your shell with the right arguments.

    The following helps in bash, I'm almost certain there's a similar flag in zsh.

    set shell=bash\ -i
    

    See $ man zsh for the right flag and the right execution order.

提交回复
热议问题