vcs_info が実装されていたら使う
for p in $fpath; do if [[ -e ${p}/vcs_info ]]; then autoload -Uz vcs_info zstyle ':vcs_info:*' enable git svn hg bzr zstyle ':vcs_info:bzr:*' use-simple true zstyle ':vcs_info:(svn|bzr):*' branchformat '%b:r%r' zstyle ':vcs_info:*' formats ' [%b]' zstyle ':vcs_info:*' actionformats ' [%b|%a]' precmd () { psvar=() LANG=en_US.UTF-8 vcs_info [[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_" } fi done
力技。