Alter $PATH in vim/macvim so as to find the right ruby binary

后端 未结 3 1629
渐次进展
渐次进展 2021-01-03 10:47

In trying to harmonize environments between a ZSH session and the vim/macvim access of the shell, a which ruby from the shell shows $HOME/.rvm/rubies/ruby-1

相关标签:
3条回答
  • 2021-01-03 11:21

    I don't know if it applies to zsh but depending on how it's started, bash reads some files and not others. Having this line in my ~/.vimrc ensures that $PATH is the same in Vim and in my shell.

    set shell=bash\ -i
    

    But it depends on how you start/customize your shell.

    See :help 'shell' and zsh's manual.

    0 讨论(0)
  • 2021-01-03 11:29

    The answer given here worked for me pretty well:

    How to use correct ruby in vim ? How to modify $PATH in VIM?

    And the explanation given for the different $PATH in interactive and non-interactive mode is straightforward:

    https://github.com/dotphiles/dotzsh#mac-os-x

    0 讨论(0)
  • 2021-01-03 11:38

    Maybe :$PATH=$HOME.'/.rvm/rubies/ruby-1.9.3/bin/ruby:'.$PATH in your vimrc. Probably hacky, but maybe it'll work.

    0 讨论(0)
提交回复
热议问题