configs/dot.zsh/functions/prompt_git_info
2012-10-26 02:30:01 +02:00

22 lines
458 B
Text

if [ -n "$__CURRENT_GIT_BRANCH" ]; then
local p=""
local s=""
p+="$__CURRENT_GIT_BRANCH"
case "$__CURRENT_GIT_BRANCH_STATUS" in
ahead)
s+="↑"
;;
diverged)
s+="↕"
;;
behind)
s+="↓"
;;
esac
if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then
s+="⚡"
fi
printf "(%s%s)" "%{${fg[yellow]}%} $p %{${PR_LIGHT_RED}%}" "$s%{${terminfo[sgr0]}%}"
fi