diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-11-07 10:16:04 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-11-07 10:16:04 +0900 |
| commit | b5601e86cc6aa8511722a2b450e1540e7af92f2f (patch) | |
| tree | 29e59d71ae0ab1ce83bd0ed819688735795be5ee | |
| parent | 818119a7fd2e8131769b35f54841b69b28bac983 (diff) | |
| download | dotfiles-b5601e86cc6aa8511722a2b450e1540e7af92f2f.tar.gz dotfiles-b5601e86cc6aa8511722a2b450e1540e7af92f2f.tar.zst dotfiles-b5601e86cc6aa8511722a2b450e1540e7af92f2f.zip | |
.zshrc: display stash count in VCS info
| -rw-r--r-- | .zshrc | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -269,10 +269,19 @@ zmodload zsh/complist autoload -Uz vcs_info +zstyle ':vcs_info:git:*' formats ' (%b)%u%m' +zstyle ':vcs_info:git:*' actionformats ' (%b %a)%u%m' +zstyle ':vcs_info:git:*' unstagedstr '+' zstyle ':vcs_info:git:*' check-for-changes true -zstyle ':vcs_info:git:*' unstagedstr "+" -zstyle ':vcs_info:*' formats " (%b)%u" -zstyle ':vcs_info:*' actionformats ' (%b %a)%u' +zstyle ':vcs_info:git+set-message:*' hooks git-stash-count + +# Add stash count to VCS info. +function +vi-git-stash-count() { + local stash="$(git stash list 2>/dev/null | wc -l | tr -d ' ')" + if [[ "${stash}" -gt 0 ]]; then + hook_com[misc]+=" [${stash}]" + fi +} function __update_vcs_info() { |
