aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-04-02 02:52:30 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-04-02 02:52:30 +0300
commit393e1c827b921f31cc0d74c9bf65076b69876708 (patch)
tree28c34046e30a901f87383c6ae97186461f114a00 /powerlevel9k.zsh-theme
parent5b0eeadabb75c03fb4e63442294d0b8d25897db5 (diff)
parent27a13b3f4823835d9ef2ec22dbb47e9007003676 (diff)
Merge pull request #18 from dritter/dritter/show_stash_count
Show stash count for git.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme13
1 files changed, 12 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index c8a9ac89..443f7cc3 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -71,7 +71,7 @@ zstyle ':vcs_info:*' actionformats " %b %F{red}| %a%f"
zstyle ':vcs_info:*' stagedstr " %F{$DEFAULT_COLOR}$VCS_STAGED_ICON%f"
zstyle ':vcs_info:*' unstagedstr " %F{$DEFAULT_COLOR}$VCS_UNSTAGED_ICON%f"
-zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-aheadbehind git-remotebranch git-tagname
+zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-aheadbehind git-stash git-remotebranch git-tagname
# For Hg, only show the branch name
zstyle ':vcs_info:hg*:*' branchformat "%b"
@@ -208,6 +208,17 @@ function +vi-git-tagname() {
[[ -n ${tag} ]] && hook_com[branch]=" %F{$DEFAULT_COLOR}${tag}%f"
}
+# Show count of stashed changes
+# Port from https://github.com/whiteinge/dotfiles/blob/5dfd08d30f7f2749cfc60bc55564c6ea239624d9/.zsh_shouse_prompt#L268
+function +vi-git-stash() {
+ local -a stashes
+
+ if [[ -s $(git rev-parse --git-dir)/refs/stash ]] ; then
+ stashes=$(git stash list 2>/dev/null | wc -l)
+ hook_com[misc]+=" %F{$DEFAULT_COLOR}⍟${stashes}%f"
+ fi
+}
+
function +vi-vcs-detect-changes() {
if [[ -n ${hook_com[staged]} ]] || [[ -n ${hook_com[unstaged]} ]]; then
VCS_WORKDIR_DIRTY=true