Second vcs_info_msg exported containing git repo root path
authorJoerg Jaspert <joerg.jaspert@dlh.de>
Thu, 3 Mar 2016 08:51:00 +0000 (09:51 +0100)
committerJoerg Jaspert <joerg.jaspert@dlh.de>
Thu, 3 Mar 2016 08:51:00 +0000 (09:51 +0100)
.zsh/functions/prompt_ganneff_setup

index a6efe40..fd46554 100644 (file)
@@ -295,7 +295,7 @@ ${PR_SHIFT_IN}${PR_HBAR}${PR_CYAN}${PR_HBAR}${PR_SHIFT_OUT}${PR_NO_COLOR} '
         if zstyle -T ':prompt:ganneff' set_vcs_info_defaults; then
             # gather version control information for inclusion in a prompt
             # we will only be using one variable, so let the code know now.
-            zstyle ':vcs_info:*' max-exports 1
+            zstyle ':vcs_info:*' max-exports 2
             zstyle ':vcs_info:*' use-prompt-escapes
             zstyle ':vcs_info:*' use_simple
             zstyle ':vcs_info:*' stagedstr      "!"
@@ -304,8 +304,8 @@ ${PR_SHIFT_IN}${PR_HBAR}${PR_CYAN}${PR_HBAR}${PR_SHIFT_OUT}${PR_NO_COLOR} '
 
             # change vcs_info formats for the prompt
             zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "${PR_YELLOW}%b%{${PR_RED}%}:${PR_YELLOW}%r${PR_NO_COLOR}"
-            zstyle ':vcs_info:*' formats "(${PR_YELLOW}%s${PR_NO_COLOR})-[${PR_GREEN}%b${PR_NO_COLOR}]%m%u%c "
-            zstyle ':vcs_info:*' actionformats "(${PR_YELLOW}%s${PR_NO_COLOR})-[${PR_GREEN}%b${PR_NO_COLOR}-${PR_RED}(%a)${PR_NO_COLOR}]%m%u%c "
+            zstyle ':vcs_info:*' formats "(${PR_YELLOW}%s${PR_NO_COLOR})-[${PR_GREEN}%b${PR_NO_COLOR}]%m%u%c" "%R"
+            zstyle ':vcs_info:*' actionformats "(${PR_YELLOW}%s${PR_NO_COLOR})-[${PR_GREEN}%b${PR_NO_COLOR}-${PR_RED}(%a)${PR_NO_COLOR}]%m%u%c"
         fi
     fi
 
@@ -528,6 +528,8 @@ prompt_ganneff_precmd () {
             fi
         fi
     fi
+    # And a variant that can be used in plain cd commands - directory alias
+    hash -d gtd="${vcs_info_msg_1_}"
 }
 
 prompt_ganneff_length () {