1183 shaares
298 private links
298 private links
1 result
tagged
Git
In case it might help someone, when developping with VCS.
Copied/pasted from QuickStart:
To get this feature working quickly (including colors), you can do the following (assuming, you loaded vcs_info properly - see above):
zstyle ':vcs_info:' actionformats \
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:' formats \
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
precmd () { vcs_info }
PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg0}%f%# '
Obviously, the last two lines are there for demonstration. You need to call vcs_info from your precmd function. Once that is done you need a single quoted '${vcs_info_msg0}' in your prompt.