From d4064cdc66f0b312cd13361bdc1fdbd4fb498e5d Mon Sep 17 00:00:00 2001 From: Ilya Sheershoff Date: Mon, 27 Jun 2016 15:18:33 +0500 Subject: [PATCH] Agnoster: add current node version if .nvmrc is present Useful with nvm autoswitcher upon directory change (as described in nvm package) --- themes/agnoster.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 103041eef..7dc012d72 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -167,6 +167,13 @@ prompt_dir() { prompt_segment blue black '%~' } +# Nvm: current node version if nvmrc is present. +prompt_nvm() { + if [[ -f .nvmrc && -r .nvmrc ]]; then + prompt_segment black green "⬡ $(nvm_prompt_info)" + fi +} + # Virtualenv: current working virtualenv prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" @@ -194,6 +201,7 @@ build_prompt() { RETVAL=$? prompt_status prompt_virtualenv + prompt_nvm prompt_context prompt_dir prompt_git