c24936ece51940536f3e62fc9e458b74c2affe68

Author
steeef <steeef@gmail.com>
Committer
steeef <steeef@gmail.com>
Date

Message

added steeef theme

Diff

 1diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..a54cdce14daec92930fc99630b6abb6744d95290
 4--- /dev/null
 5+++ b/themes/steeef.zsh-theme
 6@@ -0,0 +1,68 @@
 7+# prompt style and colors based on Steve Losh's Prose theme:
 8+# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
 9+#
10+# vcs_info modifications from Bart Trojanowski's zsh prompt:
11+# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
12+
13+function virtualenv_info {
14+    [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
15+}
16+PR_GIT_UPDATE=1
17+
18+setopt prompt_subst
19+autoload colors
20+colors
21+
22+autoload -U add-zsh-hook
23+autoload -Uz vcs_info
24+
25+
26+# check-for-changes can be really slow.
27+# you should disable it, if you work with large repositories
28+zstyle ':vcs_info:*:prompt:*' check-for-changes true
29+
30+# set formats
31+# %b - branchname
32+# %u - unstagedstr (see below)
33+# %c - stagedstr (see below)
34+# %a - action (e.g. rebase-i)
35+# %R - repository path
36+# %S - path in the repository
37+PR_RST="%{${reset_color}%}"
38+FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})"
39+FMT_ACTION="(%{$fg[green]%}%a${PR_RST})"
40+FMT_UNSTAGED="%{$fg[yellow]%}!"
41+FMT_STAGED="%{$fg[yellow]%}?"
42+
43+zstyle ':vcs_info:*:prompt:*' unstagedstr   "${FMT_UNSTAGED}"
44+zstyle ':vcs_info:*:prompt:*' stagedstr     "${FMT_STAGED}"
45+zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
46+zstyle ':vcs_info:*:prompt:*' formats       "${FMT_BRANCH}"
47+zstyle ':vcs_info:*:prompt:*' nvcsformats   ""
48+
49+
50+function steeef_preexec {
51+    case "$(history $HISTCMD)" in
52+        *git*)
53+            PR_GIT_UPDATE=1
54+            ;;
55+    esac
56+}
57+add-zsh-hook preexec steeef_preexec
58+
59+function steeef_chpwd {
60+    PR_GIT_UPDATE=1
61+}
62+add-zsh-hook chpwd steeef_chpwd
63+
64+function steeef_precmd {
65+    if [[ -n "$PR_GIT_UPDATE" ]] ; then
66+        vcs_info 'prompt'
67+        PR_GIT_UPDATE=
68+    fi
69+}
70+add-zsh-hook precmd steeef_precmd
71+
72+PROMPT=$'
73+%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%} $vcs_info_msg_0_
74+$(virtualenv_info)$ '