Skip to content

Instantly share code, notes, and snippets.

@vjo
Created November 15, 2024 16:01
Show Gist options
  • Select an option

  • Save vjo/682ffa1058d883a7a6e29f9e53b38ae5 to your computer and use it in GitHub Desktop.

Select an option

Save vjo/682ffa1058d883a7a6e29f9e53b38ae5 to your computer and use it in GitHub Desktop.

Revisions

  1. vjo created this gist Nov 15, 2024.
    11 changes: 11 additions & 0 deletions script-chpwd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    ##
    # Add the following to your `~/.zshrc` after nvm is initialized
    ##

    # switch to the right node version automatically
    function chpwd() {
    # Executed whenever the current working directory is changed
    if [[ -f .nvmrc && -r .nvmrc ]]; then
    nvm use
    fi
    }