Created
September 8, 2020 11:12
-
-
Save fogrew/ee8e96d0af48b86c4880f59b8ca1eba2 to your computer and use it in GitHub Desktop.
fnm config for zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias nv='fnm use' | |
export PATH=~/.fnm/current/bin:$PATH | |
export FNM_LOGLEVEL=info | |
autoload -U add-zsh-hook | |
_fnm_autoload_hook () { | |
if [[ -f .node-version && -r .node-version ]]; then | |
echo "fnm: Found .node-version" | |
fnm use | |
elif [[ -f .nvmrc && -r .nvmrc ]]; then | |
echo "fnm: Found .nvmrc" | |
fnm use | |
fi | |
} | |
add-zsh-hook chpwd _fnm_autoload_hook \ | |
&& _fnm_autoload_hook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment