aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-03-29 20:41:02 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-03-29 20:41:02 +0300
commit71ebcb6642d2a5905d1c5035f448b9d6784c2fd5 (patch)
treeb2cccba286eca9bab6332589848ed8d1eb6fbebf /powerlevel9k.zsh-theme
parent07e4508706d9042710a4209b5393ae1156625563 (diff)
Cleaning up newly improved VCS_INFO settings.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme20
1 files changed, 14 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index fd23de10..76ac31de 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -35,15 +35,22 @@ VCS_STAGED_ICON='✚'
local VCS_WORKDIR_DIRTY=false
setopt prompt_subst
autoload -Uz vcs_info
+
+zstyle ':vcs_info:*' enable git hg
+# The `get-revision` function must be turned on for dirty-check to work for Hg
+zstyle ':vcs_info:*' get-revision true
+zstyle ':vcs_info:*' check-for-changes true
+
+zstyle ':vcs_info:*' formats "%b%c%u%m"
+zstyle ':vcs_info:*' actionformats "%b %F{red}| %a%f"
+
zstyle ':vcs_info:*' stagedstr " %F{black}$VCS_STAGED_ICON%f"
zstyle ':vcs_info:*' unstagedstr " %F{black}$VCS_UNSTAGED_ICON%f"
-zstyle ':vcs_info:*' actionformats " %b %F{red}| %a%f"
-zstyle ':vcs_info:*' formats " %b%c%u%m"
-zstyle ':vcs_info:*' check-for-changes true
+
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-aheadbehind git-remotebranch git-tagname
-zstyle ':vcs_info:hg*' get-revision true # If false, the dirty-check won't work in mercurial
-zstyle ':vcs_info:hg*:*' branchformat "%b" # only show branch
-zstyle ':vcs_info:*' enable git hg
+
+# For Hg, only show the branch name (as opposed to the rev)
+zstyle ':vcs_info:hg*:*' branchformat "%b"
## Debugging
#zstyle ':vcs_info:*+*:*' debug true
@@ -278,6 +285,7 @@ build_right_prompt() {
# Create the prompts
precmd() {
vcs_info
+
# Add a static hook to examine staged/unstaged changes.
vcs_info_hookadd set-message vcs-detect-changes
}