Browse code

Adds a new theme that only seems to work on Linux

Hayes Williams authored on 27/05/2010 at 04:49:55
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,80 @@
0
+# vim: set ts=2 textwidth=0
1
+
2
+autoload -U add-zsh-hook
3
+autoload -Uz vcs_info
4
+local c0=$(printf "\033[0m")
5
+local c1=$(printf "\033[38;5;215m")
6
+local c2=$(printf "\033[38;5;209m")
7
+local c3=$(printf "\033[38;5;203m")
8
+local c4=$(printf "\033[33;4m")
9
+local c5=$(printf "\033[38;5;137m")
10
+local c6=$(printf "\033[38;5;240m")
11
+local c7=$(printf "\033[38;5;149m")
12
+local c8=$(printf "\033[38;5;126m")
13
+local c9=$(printf "\033[38;5;162m")
14
+
15
+local foopath=$(perl /home/scp1/bin/foopath)
16
+
17
+if [ "$TERM" = "linux" ]; then
18
+    c1=$(printf "\033[34;1m")
19
+    c2=$(printf "\033[35m")
20
+    c3=$(printf "\033[31m")
21
+    c4=$(printf "\033[31;1m")
22
+    c5=$(printf "\033[32m")
23
+    c6=$(printf "\033[32;1m")
24
+    c7=$(printf "\033[33m")
25
+    c8=$(printf "\033[33;1m")
26
+    c9=$(printf "\033[34m")
27
+fi
28
+
29
+#local newtv=$(perl $HOME/devel/newtv.pl)
30
+local newtv=''
31
+
32
+zstyle ':vcs_info:*' actionformats \
33
+    '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
34
+zstyle ':vcs_info:*' formats \
35
+    "%{$c8%}%s%{$c7%}:%{$c7%}(%{$c9%}%b%{$c7%})%f "
36
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
37
+zstyle ':vcs_info:*' enable git
38
+
39
+add-zsh-hook precmd prompt_jnrowe_precmd
40
+
41
+prompt_jnrowe_precmd () {
42
+    vcs_info
43
+
44
+    if [ "${vcs_info_msg_0_}" = "" ]; then
45
+        #dir_status="|%F{3}%n%F{7}@%F{3}%m%F{7}:%F{9}%l%f"
46
+        #dir_status="$c1%n%F{7}@%F{9}%m%F{7}:%F{12}%/"
47
+        dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
48
+        #dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$foopath%} %{$c0%}(%{$c5%}%?%{$c0%})"
49
+        
50
+        PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
51
+> '
52
+    elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
53
+        dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
54
+        PROMPT='${vcs_info_msg_0_}
55
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
56
+> '
57
+    
58
+    elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
59
+        dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
60
+
61
+        PROMPT='${vcs_info_msg_0_}
62
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
63
+%{$c9%}ยท>%{$c0%} '
64
+    else
65
+        dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$c4%}%/ %{$c0%}(%{$c5%}%?%{$c0%})"
66
+        PROMPT='${vcs_info_msg_0_}
67
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
68
+> '
69
+        
70
+    fi
71
+}
72
+
73
+
74
+#PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$reset_color%} ${vcs_info_msg_0_}${dir_status}%{$reset_color%}
75
+#> '
76
+
77
+# vim: set ft=zsh ts=4 sw=4 et:
78
+
79
+