aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2015-06-04 03:09:14 +0300
committerBen Hilburn <ben.hilburn@ettus.com>2015-06-04 03:09:14 +0300
commit77cbe9a6f07a81602e47eeab107c34ba6c7b8990 (patch)
tree29f3160354acc243b8ad12b76487b86e3b7cad8c /powerlevel9k.zsh-theme
parent23e8a039ad5fcb10f45ea68ae982c6400cfd39d9 (diff)
simplifying user-defined color logic for VCS segment
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme22
1 files changed, 8 insertions, 14 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index c624a072..f65143a1 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -70,18 +70,16 @@ else
DEFAULT_COLOR_DARK="236"
fi
-# Unfortunately the foreground colors for the VCS segment have
-# to be overwritten at this point.
-# Overwrite given foreground-color by user defined variable for this segment.
local VCS_FOREGROUND_COLOR=$DEFAULT_COLOR
-local VCS_FOREGROUND_USER_VARIABLE=POWERLEVEL9K_VCS_FOREGROUND
-local VCS_FG_COLOR_MODIFIER=${(P)VCS_FOREGROUND_USER_VARIABLE}
-[[ -n $VCS_FG_COLOR_MODIFIER ]] && VCS_FOREGROUND_COLOR=$VCS_FG_COLOR_MODIFIER
-
local VCS_FOREGROUND_COLOR_DARK=$DEFAULT_COLOR_DARK
-local VCS_FOREGROUND_USER_VARIABLE_DARK=POWERLEVEL9K_VCS_DARK_FOREGROUND
-local VCS_FG_DARK_COLOR_MODIFIER=${(P)VCS_FOREGROUND_USER_VARIABLE_DARK}
-[[ -n $VCS_FG_DARK_COLOR_MODIFIER ]] && VCS_FOREGROUND_COLOR_DARK=$VCS_FG_DARK_COLOR_MODIFIER
+
+# If user has defined custom colors for the `vcs` segment, override the defaults
+if [[ -n $POWERLEVEL9K_VCS_FOREGROUND ]]; then
+ VCS_FOREGROUND_COLOR=$POWERLEVEL9K_VCS_FOREGROUND
+fi
+if [[ -n $POWERLEVEL9K_VCS_DARK_FOREGROUND ]]; then
+ VCS_FOREGROUND_COLOR_DARK=$POWERLEVEL9K_VCS_DARK_FOREGROUND
+fi
################################################################
# VCS Information Settings
@@ -140,10 +138,6 @@ fi
# Takes two arguments, background and foreground. Both can be omitted,
# rendering default background/foreground.
left_prompt_segment() {
-# Unfortunately that doesn't work. But it should. The Example in
-# http://zsh.sourceforge.net/FAQ/zshfaq03.html#l39 is quite similar.
-# local BG_COLOR_MODIFIER=${(P)POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND}
-
# Overwrite given background-color by user defined variable for this segment.
# We get as first Parameter the function name, which called this function.
# From the given function name, we strip the "prompt_"-prefix and uppercase it.