From 06c604e369ca693c7332aa94b55c74b0f5e88b27 Mon Sep 17 00:00:00 2001 From: Oren Held Date: Tue, 19 Feb 2013 00:12:47 +0200 Subject: [PATCH] Git-info: add zstyle for disabling prompt for all repos This might be useful for users who want to avoid the slow git-info call, but want to keep the aliases. Updated CTRL + C message to indicate this option. --- modules/git/functions/git-info | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index 6d0848eb..c83dcc45 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -104,6 +104,9 @@ This process may be time-intensive for certain repositories. To disable zsh git prompt for this repository, execute: git-info off +To disable zsh git prompt for all repositories, add to zpreztorc: + zstyle ':prezto:module:git:info' disable-prompt 'yes' + EOF unset _git_info_executing @@ -147,6 +150,7 @@ function git-info { local dirty=0 local dirty_format local dirty_formatted + local disable_prompt local ignore_submodules local -A info_formats local info_format @@ -200,6 +204,12 @@ function git-info { return 1 fi + # Return if git-info is disabled + zstyle -b ':prezto:module:git:info' disable-prompt 'disable_prompt' + if [[ "$disable_prompt" == "yes" ]]; then + return 1 + fi + # Used to abort and turn git-info off on SIGINT. _git_info_executing=true