This file contains hidden or 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
# Detects if a .nvmrc file exists, and switches | |
# to the specified version if it does. | |
# The contents of the .nvmrc file should simply be the node | |
# version to use, like "v0.8.11" | |
# Put this in your .zshrc file or somewhere else that is loaded automatically | |
function chpwd() { | |
emulate -L zsh | |
if [[ -f .nvmrc ]] then | |
nvm use `cat .nvmrc` | |
fi |