From 5cbe050452f488446d3916a57bd17d744997c763 Mon Sep 17 00:00:00 2001 From: "Viktor (Icon) VAD" Date: Thu, 12 Nov 2015 10:40:22 +0000 Subject: [PATCH] adding env switch to turn hg on/off --- README.md | 5 +++++ bullet-train.zsh-theme | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3d1a4..d68a3e4 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,11 @@ or don't want to see. All options must be overridden in your **.zshrc** file. |`BULLETTRAIN_GIT_BEHIND`|`" ⬇"`|Icon for behind state from remote |`BULLETTRAIN_GIT_DIVERGED`|`" ⬍"`|Icon for diverged state from remote +### Mercurial/HG + +|Variable|Default|Meaning +|--------|-------|-------| +|`BULLETTRAIN_HG_SHOW`|`true`|Show/hide that segment ## Contributors diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index a39b44a..51510ca 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -144,6 +144,11 @@ if [ ! -n "${BULLETTRAIN_GIT_EXTENDED+1}" ]; then BULLETTRAIN_GIT_EXTENDED=true fi +# HG +if [ ! -n "${BULLETTRAIN_HG_SHOW+1}" ]; then + BULLETTRAIN_HG_SHOW=true +fi + # CONTEXT if [ ! -n "${BULLETTRAIN_CONTEXT_SHOW+1}" ]; then BULLETTRAIN_CONTEXT_SHOW=false @@ -296,6 +301,10 @@ prompt_git() { } prompt_hg() { + if [[ $BULLETTRAIN_HG_SHOW == false ]]; then + return + fi + local rev status if $(hg id >/dev/null 2>&1); then if $(hg prompt >/dev/null 2>&1); then @@ -497,7 +506,7 @@ build_prompt() { prompt_nvm prompt_go prompt_git - # prompt_hg + prompt_hg prompt_end }