diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2015-04-02 03:03:11 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2015-04-02 03:03:11 +0300 |
commit | a9fcd466a3ef8fc6100de635e26ec8344d8d8706 (patch) | |
tree | 261553b56cb1fb0b71145f709f2b9d01f416c015 /powerlevel9k.zsh-theme | |
parent | 18cbe235b8e4f7e5ef30937664a5afbcdb887e47 (diff) | |
parent | 393e1c827b921f31cc0d74c9bf65076b69876708 (diff) |
Merge branch 'master' into dritter/test-ratio
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r-- | powerlevel9k.zsh-theme | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 9d823ff3..53f5023d 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -53,8 +53,13 @@ autoload -Uz vcs_info local VCS_WORKDIR_DIRTY=false local VCS_CHANGESET_PREFIX='' if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then - # Just display the first 12 characters of our changeset-ID. - VCS_CHANGESET_PREFIX="%F{$DEFAULT_COLOR_DARK}%12.12i@%f" + # Default: Just display the first 12 characters of our changeset-ID. + local VCS_CHANGESET_HASH_LENGTH=12 + if [[ -n $POWERLEVEL9K_CHANGESET_HASH_LENGTH ]]; then + VCS_CHANGESET_HASH_LENGTH=$POWERLEVEL9K_CHANGESET_HASH_LENGTH + fi + + VCS_CHANGESET_PREFIX="%F{$DEFAULT_COLOR_DARK}%0.$VCS_CHANGESET_HASH_LENGTH""i@%f" fi zstyle ':vcs_info:*' enable git hg @@ -66,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" @@ -203,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 |