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

14
.zshrc
View file

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