Vim (original) (raw)
For Bash
In order to use chruby from the !sh
shell, you need to change vim's shell:
set shell=$SHELL
This will cause vim to spawn a login shell, which will load chruby.
For Zsh
You'll probably need to sudo mv /etc/{zshenv,zprofile}
to ensure the PATH
is set correctly. (More info).
Auto-Switching
If you have auto.sh
loaded, you can cd
into a project with a .ruby-version
file and invoke the editor from the command-line. This will cause the editor to inherit the environment variables setup by chruby.