Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: (2/2) vcs_info: change default formats



From: Simon Ruderich <simon@xxxxxxxxxxxx>

This changes the default `formats' and `actionformats' styles for
vcs_info to include information enabled by the `check-for-changes'
style. Since that style is disabled by default, this doesn't change
vcs_info's default behaviour.
---
 Doc/Zsh/contrib.yo                  |    4 ++--
 Functions/VCS_Info/VCS_INFO_formats |    4 ++--
 Misc/vcs_info-examples              |    6 ------
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 2708625..665f60c 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -656,8 +656,8 @@ enditem()
 The default values for these styles in all contexts are:
 
 startsitem()
-sitem(tt(formats))(" (%s)-[%b]-")
-sitem(tt(actionformats))(" (%s)-[%b|%a]-")
+sitem(tt(formats))(" (%s)-[%b]%u%c-")
+sitem(tt(actionformats))(" (%s)-[%b|%a]%u%c-")
 sitem(tt(branchformat))("%b:%r" (for bzr, svn, svk and hg))
 sitem(tt(nvcsformats))("")
 sitem(tt(hgrevformat))("%r:%h")
diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats
index 469efa7..1380919 100644
--- a/Functions/VCS_Info/VCS_INFO_formats
+++ b/Functions/VCS_Info/VCS_INFO_formats
@@ -51,10 +51,10 @@ VCS_INFO_hook 'post-backend'
 
 if [[ -n ${hook_com[action]} ]] ; then
     zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" actionformats msgs
-    (( ${#msgs} < 1 )) && msgs[1]=' (%s)-[%b|%a]-'
+    (( ${#msgs} < 1 )) && msgs[1]=' (%s)-[%b|%a]%u%c-'
 else
     zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" formats msgs
-    (( ${#msgs} < 1 )) && msgs[1]=' (%s)-[%b]-'
+    (( ${#msgs} < 1 )) && msgs[1]=' (%s)-[%b]%u%c-'
 fi
 
 if [[ -n ${hook_com[staged]} ]] ; then
diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples
index e0f531b..742ba34 100644
--- a/Misc/vcs_info-examples
+++ b/Misc/vcs_info-examples
@@ -207,12 +207,6 @@ autoload -Uz vcs_info
 zstyle ':vcs_info:*' check-for-changes true
 zstyle ':vcs_info:*' get-revision true
 
-# Improve default formats/actionformats to display staged (%c) and
-# unstaged (%u) changes. You can change the displayed string with the
-# 'unstagedstr' and 'stagedstr' settings.
-zstyle ':vcs_info:*' formats       " (%s)-[%b]%u%c-"
-zstyle ':vcs_info:*' actionformats " (%s)-[%b|%a]%u%c-"
-
 
 # Default to running vcs_info. If possible we prevent running it later for
 # speed reasons. If set to a non empty value vcs_info is run.
-- 
1.7.1



Messages sorted by: Reverse Date, Date, Thread, Author