apple.zsh-theme 822 B

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