rixius.zsh-theme 789 B

123456789101112131415161718192021
  1. # name in folder (github)
  2. # ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right.
  3. function collapse_pwd {
  4. echo $(pwd | sed -e "s,^$HOME,~,")
  5. }
  6. function prompt_char {
  7. echo -n "%{$bg[white]%}%{$fg[red]%}"
  8. git branch >/dev/null 2>/dev/null && echo "±%{$reset_color%}" && return
  9. echo "≥%{$reset_color%}"
  10. }
  11. RIXIUS_PRE="%{$bg[white]%}%{$fg[red]%}"
  12. PROMPT='
  13. %{$RIXIUS_PRE%}%n%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
  14. $(prompt_char) '
  15. RPROMPT='%{$RIXIUS_PRE%}%T%{$reset_color%}'
  16. ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
  17. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
  18. ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RIXIUS_PRE%}!%{$reset_color%}"
  19. ZSH_THEME_GIT_PROMPT_CLEAN=" %{$RIXIUS_PRE%}√%{$reset_color%}"