feat(p10k): nerd-font glyphs for git status segment

Replace the ASCII git VCS markers with Nerd Font glyphs:
branch , detached-HEAD commit , and a distinct staged /
unstaged / untracked  breakdown (each with its count) in place
of the single '*' dirty marker; behind/ahead use / arrows.

Drop the old CONTENT_EXPANSION (hard-coded the literal arrows and
stripped all spacing for the collapsed design) and the ahead/behind
MAX_NUM=1 cap so real commit counts show. Glyphs use \uXXXX escapes
beside naming comments for auditability; all sit in the core Nerd
Font range covered by VictorMono Nerd Font Mono.
This commit is contained in:
Vuong Hoang
2026-06-26 09:28:02 -07:00
parent 30d32d1eb8
commit 898047b2eb
+15 -16
View File
@@ -142,22 +142,21 @@
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
# Don't show remote branch, current tag or stashes. # Don't show remote branch, current tag or stashes.
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
# Don't show the branch icon. # Nerd Font branch glyph () before the branch name.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=$' '
# When in detached HEAD state, show @commit where branch normally goes. # Detached HEAD: git-commit glyph () where the branch name normally goes.
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' typeset -g POWERLEVEL9K_VCS_COMMIT_ICON=$' '
# Don't show staged, unstaged, untracked indicators. # Distinct Nerd Font glyphs, each followed by its count, for the working-tree state:
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= # staged · unstaged (modified, not staged) · untracked.
# Show '*' when there are staged, unstaged or untracked files. # A category only renders when its count is non-zero.
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$' '
# Show '⇣' if local branch is behind remote. typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=$' '
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣' typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=$' '
# Show '⇡' if local branch is ahead of remote. # No separate catch-all dirty marker — the three glyphs above are the breakdown.
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡' typeset -g POWERLEVEL9K_VCS_DIRTY_ICON=
# Don't show the number of commits next to the ahead/behind arrows. # Nerd Font behind/ahead arrows (/), each followed by the commit count.
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=$' '
# Remove space between '⇣' and '⇡' and all trailing spaces. typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=$' '
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
# Grey current time. # Grey current time.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey