gentoo.zsh-theme 1.1 KB

123456789101112131415161718192021222324252627282930
  1. autoload -Uz colors && colors
  2. autoload -Uz vcs_info
  3. zstyle ':vcs_info:*' check-for-changes true
  4. zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
  5. zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
  6. zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f '
  7. zstyle ':vcs_info:*' formats '%F{5}(%F{2}%b%c%u%m%F{5})%f '
  8. zstyle ':vcs_info:svn:*' branchformat '%b'
  9. zstyle ':vcs_info:svn:*' actionformats '%F{5}(%F{2}%b%F{1}:%{3}%i%F{3}|%F{1}%a%c%u%m%F{5})%f '
  10. zstyle ':vcs_info:svn:*' formats '%F{5}(%F{2}%b%F{1}:%F{3}%i%c%u%m%F{5})%f '
  11. zstyle ':vcs_info:*' enable git cvs svn
  12. zstyle ':vcs_info:git*+set-message:*' hooks untracked-git
  13. +vi-untracked-git() {
  14. if command git status --porcelain 2>/dev/null | command grep -q '??'; then
  15. hook_com[misc]='%F{red}?'
  16. else
  17. hook_com[misc]=''
  18. fi
  19. }
  20. gentoo_precmd() {
  21. vcs_info
  22. }
  23. autoload -U add-zsh-hook
  24. add-zsh-hook precmd gentoo_precmd
  25. PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%(!.%1~.%~) ${vcs_info_msg_0_}%F{blue}%(!.#.$)%k%b%f '