fixing git colors outside of git

This commit is contained in:
Hunter Haugen 2010-11-30 10:51:56 -08:00
parent bb5204b76d
commit 179df718ca

2
.zshrc
View file

@ -81,6 +81,7 @@ export GPGKEY="48C7AF0C"
#PS1="%m%# "
prompt_precmd() {
gitcolor=""
if zgit_isgit ; then
if ! zgit_isindexclean ; then
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f](%F{cyan}$(zgit_branch)%f)>"
gitcolor=$fg[blue]
@ -88,6 +89,7 @@ prompt_precmd() {
#PROMPT="[%F{$usercolor}%n%F{white}@%F{$hostcolor}%m%F{white}:%F{blue}%~%f]>"
gitcolor=$fg[green]
fi
fi
color="%(?.$gitcolor.$fg[red])"
PROMPT="%m$color%#%{$reset_color%} "
}