aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-09-21 19:27:03 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-09-21 19:27:03 +0300
commit1a5edebae76586361258ab68cb3f26148dfe026e (patch)
tree31bc7f8c882d5f86421fd0202e13e7593295b282 /powerlevel9k.zsh-theme
parent6cec4ce40059fe4b1450794f20f7ab5fbda0735d (diff)
Added a segment that shows the current GO version number.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 86fc2c42..413a61f5 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -608,6 +608,16 @@ prompt_dir() {
"$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path"
}
+# GO-prompt
+prompt_go_version() {
+ local go_version
+ go_version=$(go version 2>&1 | grep -oe "^go[0-9.]*")
+
+ if [[ -n "$go_version" ]]; then
+ "$1_prompt_segment" "$0" "green" "255" "$go_version"
+ fi
+}
+
# Command number (in local history)
prompt_history() {
"$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" '%h'