Created
April 10, 2016 18:52
-
-
Save wvankuipers/d20b56688450d525b34230ecf5124f45 to your computer and use it in GitHub Desktop.
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
# Bash | |
# Add the following to your .bash_profile | |
function cd { | |
# actually change the directory with all args passed to the function | |
builtin cd "$@" | |
# if there's a regular file named "todo.txt"... | |
if [[ -f .nvmrc && -r .nvmrc ]]; then | |
nvm use | |
fi | |
} | |
# ZSH | |
# Add the following to a zsh script file | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
if [[ -f .nvmrc && -r .nvmrc ]]; then | |
nvm use | |
fi | |
} | |
add-zsh-hook chpwd load-nvmrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment