Browse code

Added an alias nogit to disable the git prompt (heavy repo makes it slow)

Nicolas Viennot authored on 04/05/2011 at 12:24:39
Showing 2 changed files
... ...
@@ -1,9 +1,14 @@
1 1
 # get the name of the branch we are on
2 2
 function git_prompt_info() {
3
+  [[ "$GIT_PROMPT_DISABLED" != "" ]] && return
3 4
   ref=$(git symbolic-ref HEAD 2> /dev/null) || return
4 5
   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX"
5 6
 }
6 7
 
8
+function disable_git_prompt_info() {
9
+  GIT_PROMPT_DISABLED=1
10
+}
11
+
7 12
 # Checks if working tree is dirty
8 13
 parse_git_dirty() {
9 14
   if [[ -n $(git status -s 2> /dev/null) ]]; then
... ...
@@ -50,3 +50,5 @@ if [[ -x `which hitch` ]]; then
50 50
 	alias unhitch='hitch -u'
51 51
 	hitch
52 52
 fi
53
+
54
+alias nogit="disable_git_prompt_info"