97c66649485e227aba86b6006a6058a981da5092

Author
James Rowe <jnrowe@gmail.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Added initial jnrowe theme.

Diff

 1diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..7c8a7082e96696931d797f1e847d7eeef2f4c581
 4--- /dev/null
 5+++ b/themes/jnrowe.zsh-theme
 6@@ -0,0 +1,31 @@
 7+autoload -U add-zsh-hook
 8+autoload -Uz vcs_info
 9+
10+zstyle ':vcs_info:*' actionformats \
11+    '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
12+zstyle ':vcs_info:*' formats \
13+    '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
14+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
15+zstyle ':vcs_info:*' enable git
16+
17+add-zsh-hook precmd prompt_jnrowe_precmd
18+
19+prompt_jnrowe_precmd () {
20+    vcs_info
21+
22+    if [ "${vcs_info_msg_0_}" = "" ]; then
23+        dir_status="%F{2}→%f"
24+    elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
25+        dir_status="%F{1}▶%f"
26+    elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then
27+        dir_status="%F{3}▶%f"
28+    else
29+        dir_status="%F{2}▶%f"
30+    fi
31+}
32+
33+local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
34+
35+PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
36+
37+#  vim: set ft=zsh ts=4 sw=4 et: