From 898047b2eb0d6b5f878bfe5ce5521f44c2089a37 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Fri, 26 Jun 2026 09:28:02 -0700 Subject: [PATCH] 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. --- home_root/.p10k.zsh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/home_root/.p10k.zsh b/home_root/.p10k.zsh index a289c59..f98ef80 100644 --- a/home_root/.p10k.zsh +++ b/home_root/.p10k.zsh @@ -142,22 +142,21 @@ typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan # Don't show remote branch, current tag or stashes. typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind) - # Don't show the branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= - # When in detached HEAD state, show @commit where branch normally goes. - typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' - # Don't show staged, unstaged, untracked indicators. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON= - # Show '*' when there are staged, unstaged or untracked files. - typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*' - # Show '⇣' if local branch is behind remote. - typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣' - # Show '⇡' if local branch is ahead of remote. - typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡' - # Don't show the number of commits next to the ahead/behind arrows. - typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1 - # Remove space between '⇣' and '⇡' and all trailing spaces. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }' + # Nerd Font branch glyph () before the branch name. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=$' ' + # Detached HEAD: git-commit glyph () where the branch name normally goes. + typeset -g POWERLEVEL9K_VCS_COMMIT_ICON=$' ' + # Distinct Nerd Font glyphs, each followed by its count, for the working-tree state: + # staged · unstaged (modified, not staged) · untracked. + # A category only renders when its count is non-zero. + typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$' ' + typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=$' ' + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=$' ' + # No separate catch-all dirty marker — the three glyphs above are the breakdown. + typeset -g POWERLEVEL9K_VCS_DIRTY_ICON= + # Nerd Font behind/ahead arrows (/), each followed by the commit count. + typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=$' ' + typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=$' ' # Grey current time. typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey