From 4ba3c010f6fa66dcf7d785251c80c416454b6e90 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 8 Jun 2021 11:47:19 +0200 Subject: display "wip" in git status if the latest commit's summary contains "wip" or "WIP" (#1425) --- config/p10k-lean-8colors.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config/p10k-lean-8colors.zsh') diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 57f1bd12..d02e3a39 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -345,7 +345,7 @@ # Formatter for Git status. # - # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the function to customize how Git status looks. # @@ -411,6 +411,11 @@ res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" fi + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + # ⇣42 if behind the remote. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. -- cgit v1.2.3