diff --git a/git/gitignore_global.symlink b/git/gitignore_global.symlink index ea4a73b..7bcdb8b 100644 --- a/git/gitignore_global.symlink +++ b/git/gitignore_global.symlink @@ -18,3 +18,6 @@ Icon # typescript command garbage tscommand*.txt + +# nvm - the Node Version Manager +.nvmrc diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink index c59b22d..f08392c 100644 --- a/zsh/zshrc.symlink +++ b/zsh/zshrc.symlink @@ -21,7 +21,7 @@ fi # initialize autocomplete -autoload -U compinit +autoload -U compinit add-zsh-hook compinit for config ($ZSH/**/*completion.sh) source $config @@ -63,6 +63,13 @@ fi # source nvm export NVM_DIR=~/.nvm +load-nvmrc() { + if [[ -f .nvmrc && -r .nvmrc ]]; then + nvm use + fi +} +add-zsh-hook chpwd load-nvmrc + if hash brew 2>/dev/null; then source $(brew --prefix nvm)/nvm.sh source `brew --prefix`/etc/profile.d/z.sh