Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Here's the order of Zsh startup files: * First, read `/etc/zshenv` * Next, read `~/.zshenv` * Next, IF the shell is a login shell, read `/etc/zprofile`, followed by `~/.zprofile` * Next, IF the shell is interactive, read `/etc/zshrc`, followed by `~/.zshrc` * Finally, if the shell is a login shell, read `/etc/zlogin`, followed by `~/.zlogin` In Vim, which runs a non-login non-interactive shell, only `/etc/zshenv` then `~/.zshenv` are run. Since the end of `~/.zshenv` puts ASDF at the front of the `$PATH`, ASDF's shims are correctly set up for Vim. (`:!which ruby` returns `/usr/local/opt/asdf/shims/ruby`). However, in my daily usage, I run a login interactive shell, which means that `/etc/zprofile` gets run after `~/.zshenv`. And here's the contents of `/etc/zprofile`: # system-wide environment settings for zsh(1) if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi That `path_helper` line puts `/usr/local/bin` and `/usr/bin` (among others) at the front of the `$PATH`, which gives precedence to the Homebrew-installed Ruby at `/usr/local/bin/ruby` (or, even if that weren't installed, it'd just fall back to the system Ruby at `/usr/bin/ruby`). Thus, ASDF is clobbered. We need to run ASDF: * in `~/.zshenv` for Vim * in `~/.zshrc` for everyday usage So just run it twice. It's not an expensive script. This reverts commit 39f2d43.
- Loading branch information