candy-kingdom.zsh-theme 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # neuralsanwich.zsh-theme
  2. if [ "x$OH_MY_ZSH_HG" = "x" ]; then
  3. OH_MY_ZSH_HG="hg"
  4. fi
  5. function hg_prompt_info {
  6. $OH_MY_ZSH_HG prompt --angle-brackets "\
  7. < on %{$fg[magenta]%}<branch>%{$reset_color%}>\
  8. < at %{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
  9. %{$fg[green]%}<status|modified|unknown><update>%{$reset_color%}<
  10. patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
  11. }
  12. function box_name {
  13. [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-HOST}
  14. }
  15. PROMPT='
  16. %{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
  17. %(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
  18. ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
  19. ZSH_THEME_GIT_PROMPT_CLEAN=""
  20. ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
  21. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
  22. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
  23. local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
  24. RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'