Browse code

Rename guru theme to sunrise

Adam Lindberg authored on 07/06/2011 at 13:42:55
Showing 2 changed files
1 1
deleted file mode 100644
... ...
@@ -1,96 +0,0 @@
1
-#-------------------------------------------------------------------------------
2
-# Guru theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com)
3
-# Intended to be used with Solarized: http://ethanschoonover.com/solarized
4
-# (Needs Git plugin for current_branch method)
5
-#-------------------------------------------------------------------------------
6
-
7
-# Color shortcuts
8
-R=$fg[red]
9
-G=$fg[green]
10
-M=$fg[magenta]
11
-RB=$fg_bold[red]
12
-YB=$fg_bold[yellow]
13
-BB=$fg_bold[blue]
14
-RESET=$reset_color
15
-
16
-if [ "$(whoami)" = "root" ]; then
17
-    PROMPTCOLOR="%{$RB%}" PREFIX="-!-";
18
-else
19
-    PROMPTCOLOR="" PREFIX="---";
20
-fi
21
-
22
-local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
23
-
24
-# Get the status of the working tree (copied and modified from git.zsh)
25
-custom_git_prompt_status() {
26
-  INDEX=$(git status --porcelain 2> /dev/null)
27
-  STATUS=""
28
-  # Non-staged
29
-  if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
30
-    STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
31
-  fi
32
-  if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
33
-    STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
34
-  fi
35
-  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
36
-    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
37
-  fi
38
-  if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then
39
-    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
40
-  elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
41
-    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
42
-  elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
43
-    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
44
-  fi
45
-  # Staged
46
-  if $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
47
-    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS"
48
-  fi
49
-  if $(echo "$INDEX" | grep '^R' &> /dev/null); then
50
-    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS"
51
-  fi
52
-  if $(echo "$INDEX" | grep '^M  ' &> /dev/null); then
53
-    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS"
54
-  fi
55
-  if $(echo "$INDEX" | grep '^A' &> /dev/null); then
56
-    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS"
57
-  fi
58
-
59
-  if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then
60
-    STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS"
61
-  fi
62
-
63
-  echo $STATUS
64
-}
65
-
66
-# get the name of the branch we are on (copied and modified from git.zsh)
67
-function custom_git_prompt() {
68
-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
69
-  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX"
70
-}
71
-
72
-# %B sets bold text
73
-PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
74
-RPS1="${return_code}"
75
-
76
-ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹"
77
-ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} "
78
-
79
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*"
80
-ZSH_THEME_GIT_PROMPT_CLEAN=""
81
-
82
-ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔"
83
-
84
-ZSH_THEME_GIT_STATUS_PREFIX=" "
85
-
86
-# Staged
87
-ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A"
88
-ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M"
89
-ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R"
90
-ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D"
91
-
92
-# Not-staged
93
-ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇"
94
-ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M"
95
-ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D"
96
-ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU"
97 1
new file mode 100644
... ...
@@ -0,0 +1,96 @@
0
+#-------------------------------------------------------------------------------
1
+# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com)
2
+# Intended to be used with Solarized: http://ethanschoonover.com/solarized
3
+# (Needs Git plugin for current_branch method)
4
+#-------------------------------------------------------------------------------
5
+
6
+# Color shortcuts
7
+R=$fg[red]
8
+G=$fg[green]
9
+M=$fg[magenta]
10
+RB=$fg_bold[red]
11
+YB=$fg_bold[yellow]
12
+BB=$fg_bold[blue]
13
+RESET=$reset_color
14
+
15
+if [ "$(whoami)" = "root" ]; then
16
+    PROMPTCOLOR="%{$RB%}" PREFIX="-!-";
17
+else
18
+    PROMPTCOLOR="" PREFIX="---";
19
+fi
20
+
21
+local return_code="%(?..%{$R%}%? ↵%{$RESET%})"
22
+
23
+# Get the status of the working tree (copied and modified from git.zsh)
24
+custom_git_prompt_status() {
25
+  INDEX=$(git status --porcelain 2> /dev/null)
26
+  STATUS=""
27
+  # Non-staged
28
+  if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
29
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
30
+  fi
31
+  if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
32
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
33
+  fi
34
+  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
35
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
36
+  fi
37
+  if $(echo "$INDEX" | grep '^.M ' &> /dev/null); then
38
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
39
+  elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
40
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
41
+  elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
42
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
43
+  fi
44
+  # Staged
45
+  if $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
46
+    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_DELETED$STATUS"
47
+  fi
48
+  if $(echo "$INDEX" | grep '^R' &> /dev/null); then
49
+    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_RENAMED$STATUS"
50
+  fi
51
+  if $(echo "$INDEX" | grep '^M  ' &> /dev/null); then
52
+    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED$STATUS"
53
+  fi
54
+  if $(echo "$INDEX" | grep '^A' &> /dev/null); then
55
+    STATUS="$ZSH_THEME_GIT_PROMPT_STAGED_ADDED$STATUS"
56
+  fi
57
+
58
+  if $(echo -n "$STATUS" | grep '.*' &> /dev/null); then
59
+    STATUS="$ZSH_THEME_GIT_STATUS_PREFIX$STATUS"
60
+  fi
61
+
62
+  echo $STATUS
63
+}
64
+
65
+# get the name of the branch we are on (copied and modified from git.zsh)
66
+function custom_git_prompt() {
67
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
68
+  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(git_prompt_ahead)$(custom_git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX"
69
+}
70
+
71
+# %B sets bold text
72
+PROMPT='%B$PREFIX %2~ $(custom_git_prompt)%{$M%}%B»%b%{$RESET%} '
73
+RPS1="${return_code}"
74
+
75
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$YB%}‹"
76
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$YB%}›%{$RESET%} "
77
+
78
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$R%}*"
79
+ZSH_THEME_GIT_PROMPT_CLEAN=""
80
+
81
+ZSH_THEME_GIT_PROMPT_AHEAD="%{$BB%}➔"
82
+
83
+ZSH_THEME_GIT_STATUS_PREFIX=" "
84
+
85
+# Staged
86
+ZSH_THEME_GIT_PROMPT_STAGED_ADDED="%{$G%}A"
87
+ZSH_THEME_GIT_PROMPT_STAGED_MODIFIED="%{$G%}M"
88
+ZSH_THEME_GIT_PROMPT_STAGED_RENAMED="%{$G%}R"
89
+ZSH_THEME_GIT_PROMPT_STAGED_DELETED="%{$G%}D"
90
+
91
+# Not-staged
92
+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$R%}⁇"
93
+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$R%}M"
94
+ZSH_THEME_GIT_PROMPT_DELETED="%{$R%}D"
95
+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$R%}UU"