diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-08-14 07:57:25 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-08-14 08:28:50 +0300 |
commit | 4ba78dc2be7bc5cb10231d5fbeefaa0f2967b0f4 (patch) | |
tree | a40eb07bc39c609657612337b03a88cc43ae23eb /config/p10k-lean.zsh | |
parent | d68bd813aeba8d0c19f2ff4a04c50ce5971a9915 (diff) |
shorten git branch name if over 32 chars long; tune colors
Diffstat (limited to 'config/p10k-lean.zsh')
-rw-r--r-- | config/p10k-lean.zsh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index ea74b926..b383213c 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -271,8 +271,13 @@ fi # 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. - vcs+='${${VCS_STATUS_LOCAL_BRANCH:+%76F'${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}'${VCS_STATUS_LOCAL_BRANCH//\%/%%}}' + # If on a branch... + vcs+='${${VCS_STATUS_LOCAL_BRANCH:+%76F'${(g::)POWERLEVEL9K_VCS_BRANCH_ICON} + # If local branch name is at most 32 characters long, show it in full. + vcs+='${${${$(($#VCS_STATUS_LOCAL_BRANCH<=32)):#0}:+${VCS_STATUS_LOCAL_BRANCH//\%/%%}}' + # If local branch name is over 32 characters long, show the first 12 … the last 12. + vcs+=':-${VCS_STATUS_LOCAL_BRANCH[1,12]//\%/%%}%28F…%76F${VCS_STATUS_LOCAL_BRANCH[-12,-1]//\%/%%}}}' + # '@72f5c8a' if not on a branch. vcs+=':-%f@%76F${VCS_STATUS_COMMIT[1,8]}}' # ':master' if the tracking branch name differs from local branch. vcs+='${${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH}:+%f:%76F${VCS_STATUS_REMOTE_BRANCH//\%/%%}}' @@ -306,7 +311,6 @@ fi typeset -g POWERLEVEL9K_VCS_{CLEAN,UNTRACKED,MODIFIED}_CONTENT_EXPANSION=$vcs # When Git status is being refreshed asynchronously, display the last known repo status in grey. typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION=${${vcs//\%f}//\%<->F} - typeset -g POWERLEVEL9K_VCS_LOADING_FOREGROUND=244 # Enable counters for staged, unstaged, etc. typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 @@ -322,6 +326,7 @@ fi # isn't in an svn or hg reposotiry. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + typeset -g POWERLEVEL9K_VCS_LOADING_FOREGROUND=244 # 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_FOREGROUND=76 |