You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
470 B

CSTATUS=""
update_cstatus() {
git_stat=`cd /opt/tools/c/repo; git diff --shortstat | tr -c -d '[0-9,]'`
if [[ "$git_stat" = "" ]]; then
CSTATUS=""
else
stats=(${(@s:,:)git_stat})
CSTATUS="[%F{green}+${stats[2]}%f/%F{red}-${stats[3]}%f]"
fi
}
autoload -U add-zsh-hook
add-zsh-hook preexec update_cstatus
add-zsh-hook precmd update_cstatus
setopt PROMPT_SUBST
PS1='%T $CSTATUS %(?.%F{green}√.%F{red}?%?)%f %F{#666}%~%f %# '
alias c="/opt/tools/c/src/c.sh"