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