Parent directory

gentoo.zsh-theme

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