Skip to content

Instantly share code, notes, and snippets.

@fogrew
Created September 8, 2020 11:12
Show Gist options
  • Save fogrew/ee8e96d0af48b86c4880f59b8ca1eba2 to your computer and use it in GitHub Desktop.
Save fogrew/ee8e96d0af48b86c4880f59b8ca1eba2 to your computer and use it in GitHub Desktop.
fnm config for zsh
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