Browse code

Revert "Added my prompt theme, with a tweak to the core oh-my-zsh to support it. My git_prompt_info function not only reports the branch and dirty status, but also whether or not the branch is ahead or behind of the remote, or both. It also switches the prompt colour from green to red if the previous command exited with a non-zero value (i.e. failed)."

This reverts commit 14a1ce80bbf7362ab2856cdd050714f02649fe3f.

Robby Russell authored on 09/11/2009 at 15:33:51
Showing 2 changed files
... ...
@@ -4,7 +4,6 @@ case "$TERM" in
4 4
       print -Pn "\e]0;%n@%m: $1\a"  # xterm
5 5
     }
6 6
     precmd () {
7
-      oh_my_zsh_theme_precmd
8 7
       print -Pn "\e]0;%n@%m: %~\a"  # xterm
9 8
     }
10 9
     ;;
... ...
@@ -15,7 +14,6 @@ case "$TERM" in
15 15
       print -Pn "\e]0;%n@%m: $1\a"  # xterm
16 16
     }
17 17
     precmd () {
18
-      oh_my_zsh_theme_precmd
19 18
       echo -ne "\ekzsh\e\\"
20 19
       print -Pn "\e]0;%n@%m: %~\a"  # xterm
21 20
     }
22 21
deleted file mode 100644
... ...
@@ -1,40 +0,0 @@
1
-git_prompt_info() {
2
-  branch=$(git symbolic-ref HEAD 2> /dev/null) || return
3
-  git_status="$(git status 2> /dev/null)"
4
-  state=""
5
-  case $git_status in
6
-    *Changed\ but\ not\ updated*)
7
-      state="%{$fg[red]%}⚡"
8
-    ;;;
9
-    *Untracked\ files*)
10
-      state="%{$fg[red]%}⚡"
11
-    ;;;
12
-  esac
13
-  
14
-  remote=""
15
-  case $git_status in
16
-    *Your\ branch\ is\ ahead*)
17
-      remote="%{$fg[yellow]%}↑"
18
-    ;;;
19
-    
20
-    *Your\ branch\ is\ behind*)
21
-      remote="%{$fg[yellow]%}↓"
22
-    ;;;
23
-    
24
-    "Your branch and")
25
-      remote="%{$fg[yellow]%}"
26
-    ;;;
27
-  esac
28
-  echo " %{$fg[yellow]%}(${branch#refs/heads/})${remote}${state}"
29
-}
30
-
31
-function oh_my_zsh_theme_precmd() {
32
-  local previous_return_value=$?;
33
-  prompt="%{$fg[light_gray]%}%c%{$fg[yellow]%}$(git_prompt_info)%{$fg[white]%}"
34
-  if test $previous_return_value -eq 0
35
-  then
36
-    export PROMPT="%{$fg[green]%}➜  %{$fg[white]%}${prompt}%{$fg[green]%} $%{$fg[white]%} "
37
-  else
38
-    export PROMPT="%{$fg[red]%}➜  %{$fg[white]%}${prompt}%{$fg[red]%} $%{$fg[white]%} "
39
-  fi
40
-}
41 1
\ No newline at end of file