X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/c77653dfa43386ef5c5ded93999104a1238e077c..99f0134124fbae8c036a79ba0d6c3dd63d69422f:/zsh/lib/99-prompt.zsh diff --git a/zsh/lib/99-prompt.zsh b/zsh/lib/99-prompt.zsh index f5ea7ed..e7db942 100644 --- a/zsh/lib/99-prompt.zsh +++ b/zsh/lib/99-prompt.zsh @@ -79,10 +79,20 @@ git_prompt_status() { fi done < <(${(z)status_cmd} 2> /dev/null) - local git_status=" " + local git_status=" " + # Format tags + local tags=( $(git tag --points-at) ) + if (( ${#tags} > 0 )); then + local icon=󰓹 + (( ${#tags} > 1)) && icon=󰓻 + git_status+="$icon%{$fg_bold[yellow]%}${(j:,:)tags}" + elif [[ "$head" == '(detached)' ]]; then + git_status+="%{$fg_bold[white]%}󰌸" + fi - # Format branch and commit - git_status+="%{$fg_bold[green]%}$head" + if [[ "$head" != '(detached)' ]]; then + git_status+="%{$fg_bold[green]%}$head" + fi git_status+="%{$fg_no_bold[yellow]%}(${oid[1,8]})" # Format upstream