All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 # Set up vcs_info subsystem
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
8 # Source repository: git://git.madduck.net/etc/zsh.git
11 # see zsh-betacontrib(1)
15 # %s The vcs in use (git, hg, svn etc.)
16 # %b Information about the current branch.
17 # %a An identifier, that describes the action. Only makes sense in actionformats.
18 # %i The current revision number or identifier.
19 # %c The string from the stagedstr style if there are staged changes in the repository.
20 # %u The string from the unstagedstr style if there are unstaged changes in the repository.
21 # %R base directory of the repository.
22 # %r repository name. If %R is /foo/bar/repoXY, %r is repoXY.
23 # %S subdirectory within a repository. If $PWD is /foo/bar/reposXY/beer/tasty, %S is
25 # %m A "misc" replacement. It is at the discretion of the backend to decide what this
26 # replacement expands to. It is currently used only by the hg backend. The hg backend
27 # replaces %m with the global hash value of the current revision.
29 zstyle ':vcs_info:*' disable cdv darcs mtn svk p4 tla
30 zstyle ':vcs_info:*' check-for-changes true
31 zstyle ':vcs_info:*' max-exports 6
32 zstyle ':vcs_info:*' formats '%R' '%s' '%b' '' '%c%u' '%S'
33 zstyle ':vcs_info:*' actionformats '%R' '%s' '%b' '%a' '%c%u' '%S'
38 local prefix="${vcs_info_msg_0_/$HOME/~}"
39 local suffix="$vcs_info_msg_5_"
40 [[ $suffix = . ]] && suffix=''
42 local type="$vcs_info_msg_1_"
43 [[ $type = git ]] && type=''
44 local branch="$vcs_info_msg_2_"
45 local action="$vcs_info_msg_3_"
46 local changes="$vcs_info_msg_4_"
47 local vcsinfo="${type:+${type}:}%B${branch}%b${action:+|%B${action}%b}"
49 _make_ps1 "$prefix|$vcsinfo|$suffix${changes:+|%S${changes}%s}"
51 precmd_functions+=__vcs_info_precmd