1
|
1
|
new file mode 100644
|
...
|
...
|
@@ -0,0 +1,95 @@
|
|
0
|
+# Name: trapd00r zsh theme
|
|
1
|
+# Author: Magnus Woldrich <m@japh.se>
|
|
2
|
+#
|
|
3
|
+# This theme needs a terminal supporting 256 colors as well as unicode. It also
|
|
4
|
+# needs the script that splits up the current path and makes it fancy as located
|
|
5
|
+# here: https://github.com/trapd00r/utils/blob/master/zsh_path
|
|
6
|
+#
|
|
7
|
+# By default it spans over two lines like so:
|
|
8
|
+#
|
|
9
|
+# scp1@shiva:pts/9-> /home » scp1 (0)
|
|
10
|
+# >
|
|
11
|
+#
|
|
12
|
+# that's user@host:pts/-> splitted path (return status)
|
|
13
|
+#
|
|
14
|
+# If the current directory is a git repository, we span 3 lines;
|
|
15
|
+#
|
|
16
|
+# git❨ master ❩ DIRTY
|
|
17
|
+# scp1@shiva:pts/4-> /home » scp1 » dev » utils (0)
|
|
18
|
+# >
|
|
19
|
+
|
|
20
|
+autoload -U add-zsh-hook
|
|
21
|
+autoload -Uz vcs_info
|
|
22
|
+
|
|
23
|
+local c0=$( printf "\e[m")
|
|
24
|
+local c1=$( printf "\e[38;5;245m")
|
|
25
|
+local c2=$( printf "\e[38;5;250m")
|
|
26
|
+local c3=$( printf "\e[38;5;242m")
|
|
27
|
+local c4=$( printf "\e[38;5;197m")
|
|
28
|
+local c5=$( printf "\e[38;5;225m")
|
|
29
|
+local c6=$( printf "\e[38;5;240m")
|
|
30
|
+local c7=$( printf "\e[38;5;242m")
|
|
31
|
+local c8=$( printf "\e[38;5;244m")
|
|
32
|
+local c9=$( printf "\e[38;5;162m")
|
|
33
|
+local c10=$(printf "\e[1m")
|
|
34
|
+local c11=$(printf "\e[38;5;208m\e[1m")
|
|
35
|
+local c12=$(printf "\e[38;5;142m\e[1m")
|
|
36
|
+local c13=$(printf "\e[38;5;196m\e[1m")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+# We dont want to use the extended colorset in the TTY / VC.
|
|
40
|
+if [ "$TERM" = "linux" ]; then
|
|
41
|
+ c1=$( printf "\e[34;1m")
|
|
42
|
+ c2=$( printf "\e[35m")
|
|
43
|
+ c3=$( printf "\e[31m")
|
|
44
|
+ c4=$( printf "\e[31;1m")
|
|
45
|
+ c5=$( printf "\e[32m")
|
|
46
|
+ c6=$( printf "\e[32;1m")
|
|
47
|
+ c7=$( printf "\e[33m")
|
|
48
|
+ c8=$( printf "\e[33;1m")
|
|
49
|
+ c9=$( printf "\e[34m")
|
|
50
|
+
|
|
51
|
+ c11=$(printf "\e[35;1m")
|
|
52
|
+ c12=$(printf "\e[36m")
|
|
53
|
+ c13=$(printf "\e[31;1m")
|
|
54
|
+fi
|
|
55
|
+
|
|
56
|
+zstyle ':vcs_info:*' actionformats \
|
|
57
|
+ '%{$c8%}(%f%s)%{$c7%}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
|
|
58
|
+
|
|
59
|
+zstyle ':vcs_info:*' formats \
|
|
60
|
+ "%{$c8%}%s%%{$c7%}❨ %{$c9%}%{$c11%}%b%{$c7%} ❩%{$reset_color%}%f "
|
|
61
|
+
|
|
62
|
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
|
|
63
|
+zstyle ':vcs_info:*' enable git
|
|
64
|
+
|
|
65
|
+add-zsh-hook precmd prompt_jnrowe_precmd
|
|
66
|
+
|
|
67
|
+prompt_jnrowe_precmd () {
|
|
68
|
+ vcs_info
|
|
69
|
+ if [ "${vcs_info_msg_0_}" = "" ]; then
|
|
70
|
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
|
71
|
+ PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
|
|
72
|
+> '
|
|
73
|
+
|
|
74
|
+# modified, to be commited
|
|
75
|
+ elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
|
|
76
|
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
|
77
|
+ PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
|
|
78
|
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
|
79
|
+> '
|
|
80
|
+
|
|
81
|
+ elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
|
|
82
|
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
|
83
|
+ PROMPT='${vcs_info_msg_0_}%{$bg_bold[red]%}%{$fg_bold[blue]%}D%{$fg_bold[black]%}IRTY%{$reset_color%}
|
|
84
|
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status}%{$reset_color%}
|
|
85
|
+%{$c13%}>%{$c0%} '
|
|
86
|
+ else
|
|
87
|
+ dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
|
|
88
|
+ PROMPT='${vcs_info_msg_0_}
|
|
89
|
+%{$fg_bold[green]%}%p%{$reset_color%}${dir_status} ${vcs_info_msg_0_}%{$reset_color%}
|
|
90
|
+> '
|
|
91
|
+fi
|
|
92
|
+}
|
|
93
|
+
|
|
94
|
+# vim: set ft=zsh sw=2 et tw=0:
|