From 3a7e3bb6188c6bbd9c4e8ce534a170bae5fddbd8 Mon Sep 17 00:00:00 2001 From: James Walker Date: Sun, 1 May 2016 18:34:43 -0400 Subject: [PATCH] Add nvmrc hook on chpwd --- home/.zsh/custom/walkah.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/home/.zsh/custom/walkah.zsh b/home/.zsh/custom/walkah.zsh index 09f8f79..82d92ba 100644 --- a/home/.zsh/custom/walkah.zsh +++ b/home/.zsh/custom/walkah.zsh @@ -1 +1,9 @@ -# oh-my-zsh complains without a .zsh file in here \ No newline at end of file +# oh-my-zsh complains without a .zsh file in here + +autoload -U add-zsh-hook +load-nvmrc() { + if [[ -f .nvmrc && -r .nvmrc ]]; then + nvm use + fi +} +add-zsh-hook chpwd load-nvmrc