]> git.rmz.io Git - dotfiles.git/blob - zsh/themes/jnrowe.zsh-theme
remove lib32-testing repo
[dotfiles.git] / zsh / themes / jnrowe.zsh-theme
1 autoload -U add-zsh-hook
2 autoload -Uz vcs_info
3
4 zstyle ':vcs_info:*' actionformats \
5 '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
6 zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
7 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
8 zstyle ':vcs_info:*' enable git
9
10 add-zsh-hook precmd prompt_vcs
11
12 prompt_vcs () {
13 vcs_info
14
15 if [ "${vcs_info_msg_0_}" = "" ]; then
16 dir_status="%F{2}→%f"
17 elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
18 dir_status="%F{1}▶%f"
19 elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
20 dir_status="%F{3}▶%f"
21 else
22 dir_status="%F{2}▶%f"
23 fi
24 }
25
26 function {
27 if [[ -n "$SSH_CLIENT" ]]; then
28 PROMPT_HOST=" ($HOST)"
29 else
30 PROMPT_HOST=''
31 fi
32 }
33
34 local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
35
36 PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
37
38 # vim: set ft=zsh ts=4 sw=4 et: