rixius.zsh-theme 839 B

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