dieter.zsh-theme 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. # the idea of this theme is to contain a lot of info in a small string, by compressing some parts,
  2. # and colorcoding, which bring useful visual cues. While limiting the amount of colors and such to keep
  3. # it easy on the eyes
  4. # exact return code (when >0) is on the right, so it stays out of the way
  5. # TODO: reset exit code visual cues (not exit code itself) after showing once
  6. # TODO: compress hostname in window title
  7. typeset -A host_repr
  8. host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
  9. # local time, color coded after last return code
  10. local time="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
  11. # user part, color coded after privileges
  12. local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
  13. # Hostname part. compressed and colorcoded per host_repr array
  14. # if not found, regular hostname in default color
  15. local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
  16. # Compacted $PWD
  17. local pwd="%{$fg[blue]%}%c%{$reset_color%}"
  18. PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
  19. # i would prefer 1 icon that shows the "most drastic" deviation from head, but lets see how this works out
  20. ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
  21. ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
  22. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
  23. ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
  24. # elaborate exitcode on the right when >0
  25. local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
  26. RPS1="${return_code}"