Don't understand german? Read or subscribe to my english-only feed.

mika’s advent calendar – day 15: zsh vcs_info

Frank Terbeck, a grml developer, implemented vcs_info for the Zsh. vcs_info is a nice and flexible system for providing version control information information within the Zsh prompt. It provides support for bzr, cdv, cvs, darcs, git, hg, mtn, p4, svk, svn and tla. vcs_info is available since zsh-beta, version 4.3.6-dev-0+20080929-1 or later and using the feature it might look like this (screenshot taken from the current grml release which provides this feature via grml’s zsh config also within the stable Zsh release):

Demonstration of vcs_info inside Zsh on grml

To get an idea how to enable this feature check out the following Zsh configuration snippet:

autoload -Uz vcs_info

precmd() {
  psvar=()
  vcs_info
  [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_"
}

PS1="%m%(1v.%F{green}%1v%f.)%# "

One Response to “mika’s advent calendar – day 15: zsh vcs_info”

  1. milan Says:

    incredible! yet another reason to abandon good ol bash once for all