vcprompt
vcprompt
is a Python program that prints a short string, to be included in your prompt, with information about the current working directory for various version control systems. Includes Subversion, Git and Mercurial.
Installation
sudo su
curl -sL https://github.com/djl/vcprompt/raw/master/bin/vcprompt > /usr/local/bin/vcprompt
- Add prompt to
~/.zshrc
:PROMPT='%{$fg_bold[green]%}%p%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(vcprompt)%{ $reset_color%}$ '
Zsh: PROMPT='%{$fg_bold[green]%}%p%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(vcprompt)%{$reset_color%}$ '
Sample Output
~ $ cd ~/code/trunk/coresys ~ (ahernp@tirion)
coresys svn:trunk$ cd ~/Downloads/DMCM ~/code/trunk/coresys (ahernp@tirion)
DMCM git:master$ cd ~/Downloads/vcprompt ~/Downloads/DMCM (ahernp@tirion)
vcprompt hg:default$ dj151 ~/Downloads/vcprompt (ahernp@tirion)
(dj151)coresys svn:branches/dj151$ ~/code/dj151/coresys (ahernp@tirion)