Browse code

Create gnzh theme

Max Gonzih authored on 21/06/2011 at 09:09:57
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,47 @@
0
+# ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png
1
+# Based on bira theme
2
+
3
+# load some modules
4
+autoload -U colors zsh/terminfo # Used in the colour alias below
5
+colors
6
+setopt prompt_subst
7
+
8
+# make some aliases for the colours: (coud use normal escap.seq's too)
9
+for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
10
+  eval PR_$color='%{$fg[${(L)color}]%}'
11
+done
12
+eval PR_NO_COLOR="%{$terminfo[sgr0]%}"
13
+eval PR_BOLD="%{$terminfo[bold]%}"
14
+
15
+# Check the UID
16
+if [[ $UID -ge 1000 ]]; then # normal user
17
+  eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}'
18
+  eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
19
+  local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR'
20
+elif [[ $UID -eq 0 ]]; then # root
21
+  eval PR_USER='${PR_RED}%n${PR_NO_COLOR}'
22
+  eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}'
23
+  local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR'
24
+fi
25
+
26
+# Check if we are on SSH or not
27
+if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then 
28
+  eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH
29
+else
30
+  eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH
31
+fi
32
+
33
+local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
34
+
35
+local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}'
36
+local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}'
37
+local rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
38
+local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}'
39
+
40
+#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT "
41
+PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
42
+╰─$PR_PROMPT "
43
+RPS1="${return_code}"
44
+
45
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹"
46
+ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}"