aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-10-18 06:33:16 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-10-18 06:33:16 +0300
commitce1ea04c13b5b8466a13c0f9ee4c3b84908b1999 (patch)
treec9359c803976d661ce0553127e67203c119f81b7 /powerlevel9k.zsh-theme
parentee8c59806edd8333608e223fd4b1ff38ecf81de9 (diff)
parentb04fae917358882a0e0aabf387ed3eedf80b26e4 (diff)
Merge pull request #118 from dritter/whitespace_customization
Made whitespaces between segment separators customizable
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme16
1 files changed, 9 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index ad7ce272..7063962f 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -368,6 +368,7 @@ CURRENT_BG='NONE'
# * $3: Foreground color
# * $4: The segment content
# The latter three can be omitted,
+set_default POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS " "
left_prompt_segment() {
# Overwrite given background-color by user defined variable for this segment.
local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND
@@ -384,7 +385,7 @@ left_prompt_segment() {
[[ -n $3 ]] && fg="%F{$3}" || fg="%f"
if [[ $CURRENT_BG != 'NONE' ]] && [[ "$2" != "$CURRENT_BG" ]]; then
# Middle segment
- echo -n "%{$bg%F{$CURRENT_BG}%}$(print_icon 'LEFT_SEGMENT_SEPARATOR')%{$fg%} "
+ echo -n "%{$bg%F{$CURRENT_BG}%}$(print_icon 'LEFT_SEGMENT_SEPARATOR')%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
elif [[ "$CURRENT_BG" == "$2" ]]; then
# Middle segment with same color as previous segment
# We take the current foreground color as color for our
@@ -392,13 +393,13 @@ left_prompt_segment() {
# enough contrast.
local complement
[[ -n $3 ]] && complement=$3 || complement=$DEFAULT_COLOR
- echo -n "%{$bg%F{$complement}%}$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')%{$fg%} "
+ echo -n "%{$bg%F{$complement}%}$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
else
# First segment
- echo -n "%{$bg%}%{$fg%} "
+ echo -n "%{$bg%}%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
fi
CURRENT_BG=$2
- [[ -n $4 ]] && echo -n "$4 "
+ [[ -n $4 ]] && echo -n "$4$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
}
# End the left prompt, closes the final segment.
@@ -422,6 +423,7 @@ CURRENT_RIGHT_BG='NONE'
# * $3: Foreground color
# * $4: The segment content
# No ending for the right prompt segment is needed (unlike the left prompt, above).
+set_default POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS " "
right_prompt_segment() {
# Overwrite given background-color by user defined variable for this segment.
local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND
@@ -444,11 +446,11 @@ right_prompt_segment() {
# enough contrast.
local complement
[[ -n $3 ]] && complement=$3 || complement=$DEFAULT_COLOR
- echo -n "%F{$complement}$(print_icon 'RIGHT_SUBSEGMENT_SEPARATOR')%f%{$bg%}%{$fg%} "
+ echo -n "%F{$complement}$(print_icon 'RIGHT_SUBSEGMENT_SEPARATOR')%f%{$bg%}%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS"
else
- echo -n "%F{$2}$(print_icon 'RIGHT_SEGMENT_SEPARATOR')%f%{$bg%}%{$fg%} "
+ echo -n "%F{$2}$(print_icon 'RIGHT_SEGMENT_SEPARATOR')%f%{$bg%}%{$fg%}$POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS"
fi
- [[ -n $4 ]] && echo -n "$4 %f"
+ [[ -n $4 ]] && echo -n "$4$POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS%f"
CURRENT_RIGHT_BG=$2
}