bixel.zsh-theme 511 B

1234567891011121314151617181920
  1. # vim:ft=zsh ts=2 sw=2 sts=2
  2. # first approach to simple template using some functions from agnoster theme
  3. # Git: branch/detached head, dirty status
  4. prompt_git() {
  5. local color dirty branch
  6. if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
  7. dirty=$(parse_git_dirty)
  8. if [[ -n $dirty ]]; then
  9. color='yellow'
  10. else
  11. color='green'
  12. fi
  13. branch=$(git rev-parse --abbrev-ref HEAD)
  14. echo -n "%F{$color}➤ $branch%f"
  15. fi
  16. }
  17. PROMPT='%F{blue}%~%f '
  18. RPROMPT='$(prompt_git)'