aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/zsh/functions/prompt_git_info
blob: d6d3acb2757e8d68fd06218f2a58adae0704c80c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if [ -n "$__CURRENT_GIT_BRANCH" ]; then
    local s="${USER_LEVEL}-[%F{white}"
    s+="$__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
    s+="${USER_LEVEL}]"
 
    printf "%s%s" $s
fi