diff --git a/lib/nvm.zsh b/lib/nvm.zsh new file mode 100644 index 00000000..5cadf706 --- /dev/null +++ b/lib/nvm.zsh @@ -0,0 +1,9 @@ +# get the node.js version +function nvm_prompt_info() { + [ -f $HOME/.nvm/nvm.sh ] || return + local nvm_prompt + nvm_prompt=$(node -v 2>/dev/null) + [[ "${nvm_prompt}x" == "x" ]] && return + nvm_prompt=${nvm_prompt:1} + echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}" +}