Skip to content

Instantly share code, notes, and snippets.

@chrisyip
Created March 14, 2017 10:27
Show Gist options
  • Save chrisyip/6b87ae7594c1ca8bc0c7a7a893abf6ac to your computer and use it in GitHub Desktop.
Save chrisyip/6b87ae7594c1ca8bc0c7a7a893abf6ac to your computer and use it in GitHub Desktop.
Zsh: auto run `nvm use` if `.nvmrc` exists
function auto_nvm () {
if command -v nvm >/dev/null && [[ -a .nvmrc ]]; then
nvm use
fi
}
chpwd_functions=(${chpwd_functions[@]} "auto_nvm")
auto_nvm
@vanduc1102
Copy link

thanks man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment