Browse code

Added VCS prompt to Apple theme.

David Aaron Fendley authored on 11/09/2011 at 20:19:49
Showing 1 changed files
... ...
@@ -2,4 +2,25 @@ function toon {
2 2
   echo -n ""
3 3
 }
4 4
 
5
-PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}'
5
+get_git_dirty() { 
6
+  git diff --quiet || echo '*'
7
+}
8
+
9
+autoload -Uz vcs_info
10
+autoload -U colors && colors
11
+zstyle ':vcs_info:*' check-for-changes true
12
+zstyle ':vcs_info:*' unstagedstr '%F{red}*'   # display this when there are unstaged changes
13
+zstyle ':vcs_info:*' stagedstr '%F{yellow}+'  # display this when there are staged changes
14
+zstyle ':vcs_info:*' actionformats \
15
+    '%F{5}%F{5}[%F{2}%b%F{3}|%F{1}%a%c%u%F{5}]%f '
16
+zstyle ':vcs_info:*' formats       \
17
+    '%F{5}%F{5}[%F{2}%b%c%u%F{5}]%f '
18
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
19
+zstyle ':vcs_info:*' enable git cvs svn
20
+
21
+precmd () {
22
+    vcs_info
23
+}
24
+
25
+setopt prompt_subst
26
+PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'