]> arthur.barton.de Git - OhMyZshExtensions.git/blob - alex.zsh-theme
Initial commit
[OhMyZshExtensions.git] / alex.zsh-theme
1 # Alex "oh my ZSH" theme
2 # Based on the "Sunrise" theme, thanks!
3 # 2015-03-08, alex@barton.de
4
5 # Color shortcuts; %B sets bold text
6 B=$fg_no_bold[blue]
7 C=$fg_no_bold[cyan]
8 G=$fg_no_bold[green]
9 M=$fg_no_bold[magenta]
10 R=$fg_no_bold[red]
11 Y=$fg_no_bold[yellow]
12 RESET=$reset_color
13
14 [ "$UID" -eq 0 ] \
15         && PREFIX="%B%{$R%}-!-%{$RESET%} " \
16         || PREFIX=""
17
18 ZSH_THEME_GIT_PROMPT_PREFIX="(%{$Y%}"
19 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$RESET%}) "
20
21 ZSH_THEME_GIT_PROMPT_CLEAN="%{$G%}✔"
22 ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}✘"
23 ZSH_THEME_GIT_PROMPT_AHEAD="%{$C%}➔"
24
25 function custom_git_prompt() {
26         ref=$(git symbolic-ref HEAD 2> /dev/null) || return
27         echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/} $(parse_git_dirty)$(git_prompt_ahead)$ZSH_THEME_GIT_PROMPT_SUFFIX"
28 }
29
30 local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
31
32 PROMPT='${PREFIX}%B%2~%b $(custom_git_prompt)%{$G%}%B$%b%{$RESET%} '
33 RPS1="${return_code}"
34
35 unset LSCOLORS