oh-my-git-themes/af-magic.zsh-theme

70 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-09-26 20:55:22 -04:00
# Symbols
2015-02-11 18:39:53 -05:00
: ${is_a_git_repo_symbol:='Y'}
2015-02-14 22:10:19 -05:00
: ${has_untracked_files_symbol:='+'}
2014-09-26 20:55:22 -04:00
: ${has_adds_symbol:='+'}
: ${has_deletions_symbol:='-'}
2015-02-14 15:03:27 -05:00
: ${has_deletions_cached_symbol:='-'}
2015-02-11 18:39:53 -05:00
: ${has_modifications_symbol:='m'}
: ${has_modifications_cached_symbol:='M'}
: ${ready_to_commit_symbol:='$'}
: ${is_on_a_tag_symbol:='T'}
2014-09-28 11:41:42 -04:00
: ${needs_to_merge_symbol:='><'}
2015-02-11 18:39:53 -05:00
: ${has_upstream_symbol:='U'}
2014-09-28 11:41:42 -04:00
: ${detached_symbol:='@'}
2015-02-11 18:39:53 -05:00
: ${can_fast_forward_symbol:='f'}
: ${has_diverged_symbol:=')('}
: ${rebase_tracking_branch_symbol:='#'}
2014-09-28 11:41:42 -04:00
: ${merge_tracking_branch_symbol:='>'}
2015-02-11 18:39:53 -05:00
: ${should_push_symbol:='^'}
2015-02-14 15:03:27 -05:00
: ${has_stashes_symbol:='s'}
2014-09-26 20:55:22 -04:00
# Flags
: ${display_has_upstream:=false}
: ${display_tag:=false}
: ${display_tag_name:=true}
2014-09-28 11:41:42 -04:00
: ${two_lines:=true}
2014-09-26 20:55:22 -04:00
: ${finally:=''}
: ${use_color_off:=false}
autoload colors && colors
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
eval $COLOR='%{$fg_no_bold[${(L)COLOR}]%}' #wrap colours between %{ %} to avoid weird gaps in autocomplete
eval BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
done
eval RESET='%{$reset_color%}'
on=$WHITE
off=$WHITE
red=$RED
green=$GREEN
yellow=$YELLOW
violet=$CYAN
branch_color=$BLUE
reset=$RESET
2014-09-26 20:51:32 -04:00
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
else
local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})"
fi
# primary prompt
PROMPT='$(build_prompt)
$FG[032]%~ \
$FG[105]%(!.#.$)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
2015-06-06 15:48:54 -04:00
PSORG=''
2014-09-26 20:51:32 -04:00
# »
# color vars
eval my_gray='$FG[237]'
eval my_orange='$FG[214]'
# right prompt
2016-07-18 16:42:34 -04:00
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
RPROMPT="$my_gray%n@%m%{$reset_color%}%"
2014-09-26 20:51:32 -04:00
else
2016-07-18 16:42:34 -04:00
RPROMPT="$my_red%n@%m%{$reset_color%}%"
2014-09-26 20:51:32 -04:00
fi