From 635b0d7c99a22d996b5ca43efb56e9ec6b1ebdb4 Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 2 Aug 2019 09:39:40 +0200 Subject: [PATCH] make it easier to change the untracked files icon; fixes #147 --- README.md | 4 ++-- config/p10k-classic.zsh | 28 +++++++++++++++------------- config/p10k-lean.zsh | 28 +++++++++++++++------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 4b188da6..09f1618d 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,8 @@ It's likely your font's fault. If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git repository. Type `git status` to see these files. -You can change this symbol by editing `~/.p10k.zsh`. Search for `?` and replace it with something -else. +You can change this symbol or disable the display of untracked files altogether. Search for +`untracked files` in `~/.p10k.zsh`. ### Why does Powerlevel10k spawn extra processes? diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 444c967d..cbb4de47 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -278,7 +278,10 @@ fi #####################################[ vcs: git status ]###################################### # Git status: feature:master#tag ⇣42⇡42 *42 merge ~42 +42 !42 ?42. - # We are using parameters defined by the gitstatus plugin. See reference: + # + # You can edit the lines below to customize how Git status looks. + # + # VCS_STATUS parameters are set by gitstatus plugin. See reference: # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. local vcs='' # 'feature' or '@72f5c8a' if not on a branch. @@ -303,14 +306,20 @@ fi vcs+='${${VCS_STATUS_NUM_STAGED:#0}:+ %227F+${VCS_STATUS_NUM_STAGED}}' # !42 if have unstaged changes. vcs+='${${VCS_STATUS_NUM_UNSTAGED:#0}:+ %227F!${VCS_STATUS_NUM_UNSTAGED}}' - # ?42 if have untracked files. - vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F?${VCS_STATUS_NUM_UNTRACKED}}' + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON below if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}}' # If P9K_CONTENT is not empty, leave it unchanged. It's either "loading" or from vcs_info. vcs="\${P9K_CONTENT:-$vcs}" # Branch icon. Set this parameter to $'\uF126' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + # Disable the default Git status formatting. typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true # Install our own Git status formatter. @@ -333,16 +342,9 @@ fi # These settings are used for respositories other than Git or when gitstatusd fails and # Powerlevel10k has to fall back to using vcs_info. - typeset -g POWERLEVEL9K_VCS_{CLEAN,MODIFIED,UNTRACKED}_FOREGROUND=76 - typeset -g POWERLEVEL9K_VCS_REMOTE_BRANCH_ICON=':' - typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' - typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='⇣' - typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='⇡' - typeset -g POWERLEVEL9K_VCS_STASH_ICON='*' - typeset -g POWERLEVEL9K_VCS_TAG_ICON=$'%{\b#%}' - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=$'%{\b?%}' - typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=$'%{\b!%}' - typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$'%{\b+%}' + typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=227 ##########################[ status: exit code of the last command ]########################### # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 5a94b43f..52dcdcf4 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -263,7 +263,10 @@ fi #####################################[ vcs: git status ]###################################### # Git status: feature:master#tag ⇣42⇡42 *42 merge ~42 +42 !42 ?42. - # We are using parameters defined by the gitstatus plugin. See reference: + # + # You can edit the lines below to customize how Git status looks. + # + # VCS_STATUS parameters are set by gitstatus plugin. See reference: # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. local vcs='' # 'feature' or '@72f5c8a' if not on a branch. @@ -288,14 +291,20 @@ fi vcs+='${${VCS_STATUS_NUM_STAGED:#0}:+ %227F+${VCS_STATUS_NUM_STAGED}}' # !42 if have unstaged changes. vcs+='${${VCS_STATUS_NUM_UNSTAGED:#0}:+ %227F!${VCS_STATUS_NUM_UNSTAGED}}' - # ?42 if have untracked files. - vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F?${VCS_STATUS_NUM_UNTRACKED}}' + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON below if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}}' # If P9K_CONTENT is not empty, leave it unchanged. It's either "loading" or from vcs_info. vcs="\${P9K_CONTENT:-$vcs}" # Branch icon. Set this parameter to $'\uF126' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + # Disable the default Git status formatting. typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true # Install our own Git status formatter. @@ -318,16 +327,9 @@ fi # These settings are used for respositories other than Git or when gitstatusd fails and # Powerlevel10k has to fall back to using vcs_info. - typeset -g POWERLEVEL9K_VCS_{CLEAN,MODIFIED,UNTRACKED}_FOREGROUND=76 - typeset -g POWERLEVEL9K_VCS_REMOTE_BRANCH_ICON=':' - typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@' - typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='⇣' - typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='⇡' - typeset -g POWERLEVEL9K_VCS_STASH_ICON='*' - typeset -g POWERLEVEL9K_VCS_TAG_ICON=$'%{\b#%}' - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=$'%{\b?%}' - typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=$'%{\b!%}' - typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$'%{\b+%}' + typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=227 ##########################[ status: exit code of the last command ]########################### # Status on success. No content, just an icon.