Browse code

Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh

Sven Lito authored on 09/10/2010 at 17:56:51
Showing 5 changed files
... ...
@@ -5,7 +5,7 @@ function title {
5 5
     print -nR $'\033k'$1$'\033'\\\
6 6
 
7 7
     print -nR $'\033]0;'$2$'\a'
8
-  elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then
8
+  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then
9 9
     # Use this one instead for XTerms:
10 10
     print -nR $'\033]0;'$*$'\a'
11 11
   fi
... ...
@@ -11,3 +11,31 @@ parse_git_dirty () {
11 11
     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
12 12
   fi
13 13
 }
14
+
15
+# get the status of the working tree
16
+git_prompt_status() {
17
+  INDEX=$(git status --porcelain 2> /dev/null)
18
+  STATUS=""
19
+  if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
20
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
21
+  fi
22
+  if $(echo "$INDEX" | grep '^A  ' &> /dev/null); then
23
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
24
+  elif $(echo "$INDEX" | grep '^M  ' &> /dev/null); then
25
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
26
+  fi
27
+  if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
28
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
29
+  fi
30
+  if $(echo "$INDEX" | grep '^R  ' &> /dev/null); then
31
+    STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
32
+  fi
33
+  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
34
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
35
+  fi
36
+  if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
37
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
38
+  fi
39
+  echo $STATUS
40
+}
41
+
14 42
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+PROMPT='%{$fg_bold[cyan]%}☁ %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
3
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
4
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
5
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
0 6
\ No newline at end of file
1 7
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
1
+
2
+ZSH_THEME_GIT_PROMPT_PREFIX="("
3
+ZSH_THEME_GIT_PROMPT_SUFFIX=")"
4
+ZSH_THEME_GIT_PROMPT_DIRTY=""
5
+ZSH_THEME_GIT_PROMPT_CLEAN=""
6
+
7
+RPROMPT='$(git_prompt_status)%{$reset_color%}'
8
+
9
+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
10
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
11
+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
12
+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
13
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
14
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
0 15
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="green"; fi
1
+
2
+PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
3
+RPROMPT='[%*]'
4
+
5
+# git theming
6
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
7
+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
8
+ZSH_THEME_GIT_PROMPT_CLEAN=""
9
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}"
10
+
11
+# LS colors, made with http://geoff.greer.fm/lscolors/
12
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
13
+export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'