diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2015-12-15 02:55:24 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2015-12-15 03:59:46 +0300 |
commit | 0c528461fb1e5f38e1d4ee32c696a6955f5bfaa0 (patch) | |
tree | 33f5df4b1354d0eeafae70fbabf4f5f135214438 /powerlevel9k.zsh-theme | |
parent | 036433dd538f55d2950d40b0ca3068016877314f (diff) |
Allow users to overwrite the color for the visual identifier only.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4705a89b..7c7b2d2e 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -159,6 +159,10 @@ left_prompt_segment() { local visual_identifier if [[ -n $5 ]]; then visual_identifier="$(print_icon $5)" + # Allow users to overwrite the color for the visual identifier only. + local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR + set_default $visual_identifier_color_variable $fg + visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f" # Add an whitespace if we print more than just the visual identifier [[ -n $4 ]] && visual_identifier="$visual_identifier " fi @@ -221,6 +225,10 @@ right_prompt_segment() { if [[ -n $5 ]]; then # Swap the spaces around an icon if the icon is displayed on the right side. visual_identifier=$(print_icon $5 | sed -E "s/( *)([^ ]*)( *)/\3\2\1/") + # Allow users to overwrite the color for the visual identifier only. + local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR + set_default $visual_identifier_color_variable $fg + visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f" # Add an whitespace if we print more than just the visual identifier [[ -n $4 ]] && visual_identifier=" $visual_identifier" fi |