apple.zsh-theme 851 B

1234567891011121314151617181920212223242526272829
  1. function toon {
  2. echo -n ""
  3. }
  4. get_git_dirty() {
  5. git diff --quiet || echo '*'
  6. }
  7. autoload -Uz vcs_info
  8. autoload -U colors && colors
  9. zstyle ':vcs_info:*' check-for-changes true
  10. zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
  11. zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
  12. zstyle ':vcs_info:*' actionformats \
  13. '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
  14. zstyle ':vcs_info:*' formats \
  15. '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f '
  16. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
  17. zstyle ':vcs_info:*' enable git cvs svn
  18. theme_precmd () {
  19. vcs_info
  20. }
  21. setopt prompt_subst
  22. PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
  23. autoload -U add-zsh-hook
  24. add-zsh-hook precmd theme_precmd