]> git.donarmstrong.com Git - zsh.git/blob - .zsh/zshrc/75_vcsinfo
e4339fddf68d6537573f044b65329b54578dac81
[zsh.git] / .zsh / zshrc / 75_vcsinfo
1 # -*- mode: sh -*-
2 # zshrc/75_vcsinfo
3 #
4 # Set up vcs_info subsystem
5 #
6 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
7 # Released under the terms of the Artistic Licence 2.0
8 #
9 # Source repository: git://git.madduck.net/etc/zsh.git
10 #
11
12 # see zsh-betacontrib(1)
13
14 autoload -Uz vcs_info
15 zstyle ':vcs_info:*' get-revision true
16 zstyle ':vcs_info:*' check-for-changes true
17 zstyle ':vcs_info:*' formats '%u%c|%s:%b'
18 zstyle ':vcs_info:*' actionformats '%c%u|%s@%a:%b'
19 zstyle ':vcs_info:*' branchformat '%b@%r'
20 zstyle ':vcs_info:*' unstagedstr "%{$fg_no_bold[red]%}"
21 zstyle ':vcs_info:*' stagedstr "%{$fg_no_bold[yellow]%}"
22 zstyle ':vcs_info:*' enable hg git bzr svn cvs
23
24 # vcs-specific formatting...
25 zstyle ':vcs_info:hg*:*' hgrevformat "%r"
26 #zstyle ':vcs_info:fossil:*' fsrevformat '%.5h'
27 # Silly git doesn't honor branchformat
28 zstyle ':vcs_info:git*:*' formats '%c%u|%s@%a:%b@%.5i'
29 zstyle ':vcs_info:git*:*' actionformats '%c%u|%s@%a:%b@%.5i'
30
31 # now use the blasted colors!
32 setopt PROMPT_SUBST
33 RPROMPT='%{$fg_no_bold[green]%}${vcs_info_msg_0_}%{$reset_color%}'
34
35 #this enables vcs_info
36 precmd_functions+=vcs_info