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