more meaningful names for character variables

This commit is contained in:
Paweł Płazieński 2015-12-25 20:59:55 +01:00
parent a3c330f6a7
commit 96952834ef

41
.zshrc
View File

@ -15,14 +15,15 @@ autoload -Uz add-zsh-hook
LAST_RETURN_VALUE=0 LAST_RETURN_VALUE=0
# Characters # Characters
PLUSMINUS="\u00b1" UNSTAGED_CHARACTER="\u26a1"
BRANCH="\ue0a0" CHANGES_CHARACTER="\u00b1"
DETACHED="\u27a6" BRANCH_CHARACTER="\ue0a0"
CROSS="\u2718" DETACHED_CHARACTER="\u27a6"
LIGHTNING="\u26a1" REVISION_CHARACTER="\u2022"
GEAR="\u2699"
BULLET="\u2022" FAILED_CHARACTER="\u2718"
CROSSING="\u292c" SUPERUSER_CHARACTER="\u26a1"
JOBS_CHARACTER="\u2699"
#---------------------------------- Helpers ----------------------------------- #---------------------------------- Helpers -----------------------------------
@ -165,7 +166,7 @@ prompt_clear() {
# Root privileges # Root privileges
prompt_root() { prompt_root() {
if [[ $UID -eq 0 ]]; then if [[ $UID -eq 0 ]]; then
print -n $LIGHTNING print -n $SUPERUSER_CHARACTER
fi fi
} }
@ -191,13 +192,13 @@ prompt_status() {
local symbols local symbols
symbols=() symbols=()
if [[ $LAST_RETURN_VALUE -ne 0 ]]; then if [[ $LAST_RETURN_VALUE -ne 0 ]]; then
symbols+="%{%F{red}%}$CROSS" symbols+="%{%F{red}%}$FAILED_CHARACTER"
if [[ $LAST_RETURN_VALUE -ne 1 ]]; then if [[ $LAST_RETURN_VALUE -ne 1 ]]; then
symbols+="$CROSS $CROSS" symbols+="$FAILED_CHARACTER $FAILED_CHARACTER"
fi fi
fi fi
if [[ $(jobs -l | wc -l) -gt 0 ]]; then if [[ $(jobs -l | wc -l) -gt 0 ]]; then
symbols+="%{%F{cyan}%}$GEAR" symbols+="%{%F{cyan}%}$JOBS_CHARACTER"
fi fi
if [[ -n "$symbols" ]]; then if [[ -n "$symbols" ]]; then
echo "$symbols" echo "$symbols"
@ -245,17 +246,17 @@ zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' get-revision true zstyle ':vcs_info:*' get-revision true
# these formats are set for PROMPT # these formats are set for PROMPT
zstyle ':vcs_info:*' formats "%s $BRANCH%b $BULLET%i%u" zstyle ':vcs_info:*' formats "%s $BRANCH_CHARACTER%b $REVISION_CHARACTER%i%u"
zstyle ':vcs_info:*' actionformats "%s $BRANCH%b $BULLET%i%u [%a]" zstyle ':vcs_info:*' actionformats "%s $BRANCH_CHARACTER%b $REVISION_CHARACTER%i%u [%a]"
zstyle ':vcs_info:*' branchformat '%b' zstyle ':vcs_info:*' BRANCH_CHARACTERformat '%b'
zstyle ':vcs_info:hg*' unstagedstr "$PLUSMINUS" zstyle ':vcs_info:hg*' unstagedstr "$CHANGES_CHARACTER"
zstyle ':vcs_info:hg*' hgrevformat "%r" # default "%r:%h" zstyle ':vcs_info:hg*' hgrevformat "%r" # default "%r:%h"
zstyle ':vcs_info:git*' formats "%s $BRANCH%b%u" zstyle ':vcs_info:git*' formats "%s $BRANCH_CHARACTER%b%u"
zstyle ':vcs_info:git*' actionformats "%s $BRANCH%b%u [%a]" zstyle ':vcs_info:git*' actionformats "%s $BRANCH_CHARACTER%b%u [%a]"
zstyle ':vcs_info:git*' unstagedstr "$LIGHTNING" zstyle ':vcs_info:git*' unstagedstr "$UNSTAGED_CHARACTER"
zstyle ':vcs_info:git*' stagedstr "$PLUSMINUS" zstyle ':vcs_info:git*' stagedstr "$CHANGES_CHARACTER"
#---------------------------------- Listings ---------------------------------- #---------------------------------- Listings ----------------------------------