From ddef3a6584fdaead20082c65919377cbc5117f74 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 26 May 2015 21:51:01 +0200 Subject: [PATCH 1/5] Added the node version. --- powerlevel9k.zsh-theme | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index d1e927c8..a3f973ff 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -310,6 +310,14 @@ prompt_longstatus() { [[ -n "$symbols" ]] && $1_prompt_segment $bg $DEFAULT_COLOR "$symbols" } +# Node version +prompt_node_version() { + local nvm_prompt=$(node -v 2>/dev/null) + [[ -z "${nvm_prompt}" ]] && return + + $1_prompt_segment green white ${nvm_prompt:1} +} + # rbenv information prompt_rbenv() { if [[ -n "$RBENV_VERSION" ]]; then From 2ad6280b517d48d0baf399fe460e5ab30d81fda1 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 26 May 2015 21:53:29 +0200 Subject: [PATCH 2/5] Added documentation. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2c3f2a2d..e4843f76 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ currently available are: * **context** - Your username and host (more info below) * **dir** - Your current working directory. * **history** - The command number for the current line. +* **node_version** - Show the version number of the installed node. * **rbenv** - Ruby environment information (if one is active). * **rspec_stats** - Show a ratio of test classes vs code classes for RSpec. * **status** - The return code of the previous command, and status of background jobs. From 79678020f7a3abff84f531345234f35f1826e6e4 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 26 May 2015 21:55:07 +0200 Subject: [PATCH 3/5] Better documentation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4843f76..7678d353 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ currently available are: * **context** - Your username and host (more info below) * **dir** - Your current working directory. * **history** - The command number for the current line. -* **node_version** - Show the version number of the installed node. +* **node_version** - Show the version number of the installed Node.js. * **rbenv** - Ruby environment information (if one is active). * **rspec_stats** - Show a ratio of test classes vs code classes for RSpec. * **status** - The return code of the previous command, and status of background jobs. From 5bd4f439e464321ad402aac9b8886b8cbd188b68 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 6 Jun 2015 23:05:31 +0200 Subject: [PATCH 4/5] Added NodeJS icon. --- powerlevel9k.zsh-theme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index a3f973ff..70593abd 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -314,8 +314,9 @@ prompt_longstatus() { prompt_node_version() { local nvm_prompt=$(node -v 2>/dev/null) [[ -z "${nvm_prompt}" ]] && return + NODE_ICON="\u2B22 " # ⬢ - $1_prompt_segment green white ${nvm_prompt:1} + $1_prompt_segment green white "${nvm_prompt:1} $NODE_ICON" } # rbenv information From 505a55b61c75f13a7bbbff56be54e9e8fc0f2054 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 11 Jul 2015 14:29:48 +0200 Subject: [PATCH 5/5] Updated node-prompt. --- powerlevel9k.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 26763740..cecb19db 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -476,9 +476,9 @@ prompt_longstatus() { prompt_node_version() { local nvm_prompt=$(node -v 2>/dev/null) [[ -z "${nvm_prompt}" ]] && return - NODE_ICON="\u2B22 " # ⬢ + NODE_ICON=$'\u2B22 ' # ⬢ - $1_prompt_segment green white "${nvm_prompt:1} $NODE_ICON" + $1_prompt_segment "$0" "green" "white" "${nvm_prompt:1} $NODE_ICON" } # rbenv information