summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-10-22 02:51:44 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-10-22 02:51:44 +0300
commit981c85af39cea400281794ff31dabe242aae74fb (patch)
tree81863cdd5feb89caa4fd8c5eff7bc0ab79063c05 /powerlevel9k.zsh-theme
parent15670379ed2822208df132bdf9ab93294956309a (diff)
parente94394bc6794d302e1681424280ba9a9d3c3cd78 (diff)
Merge pull request #127 from dritter/go_prompt
Adding Go version segment.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 5b39be58..46d19331 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -647,6 +647,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'