summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-10-18 06:12:38 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-10-18 06:12:38 +0300
commitd459ec098320c69997912d8791d9d4b0ec471514 (patch)
tree511dcc94fdaf68f64962ca20ca0f54983903b9ef /powerlevel9k.zsh-theme
parent9f92995f61a9221dce98d10a86271cf000a7c12e (diff)
parentd5ffa502e26b574577f523e22476f23ec4567083 (diff)
Merge pull request #114 from alexlafroscia/add-nvm-prompt-segment
Add nvm prompt segment
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme11
1 files changed, 11 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 6108a4eb..54542a0c 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -755,6 +755,17 @@ prompt_php_version() {
fi
}
+# Node version from NVM
+# Only prints the segment if different than the default value
+prompt_nvm() {
+ local node_version=$(nvm current)
+ local nvm_default=$(cat $NVM_DIR/alias/default)
+ [[ -z "${node_version}" ]] && return
+ [[ "$node_version" =~ "$nvm_default" ]] && return
+ NODE_ICON=$'\u2B22' # ⬢
+ $1_prompt_segment "$0" "green" "011" "${node_version:1} $NODE_ICON"
+}
+
# rbenv information
prompt_rbenv() {
if [[ -n "$RBENV_VERSION" ]]; then