Browse code

use 256 colors, if available

steeef authored on 05/10/2010 at 01:05:01
Showing 1 changed files
... ...
@@ -19,6 +19,20 @@ colors
19 19
 autoload -U add-zsh-hook
20 20
 autoload -Uz vcs_info
21 21
 
22
+#use extended color pallete if available
23
+if [ $TERM = "xterm-256color" ]; then
24
+    turquoise="%F{81}"
25
+    orange="%F{166}"
26
+    purple="%F{135}"
27
+    hotpink="%F{161}"
28
+    limegreen="%F{118}"
29
+else
30
+    turquoise="$fg[cyan]"
31
+    orange="$fg[yellow]"
32
+    purple="$fg[magenta]"
33
+    hotpink="$fg[red]"
34
+    limegreen="$fg[green]"
35
+fi
22 36
 
23 37
 # enable VCS systems you use
24 38
 zstyle ':vcs_info:*' enable git svn
... ...
@@ -35,10 +49,10 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true
35 35
 # %R - repository path
36 36
 # %S - path in the repository
37 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[green]%}●"
38
+FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
39
+FMT_ACTION="(%{$limegreen%}%a${PR_RST})"
40
+FMT_UNSTAGED="%{$orange%}●"
41
+FMT_STAGED="%{$limegreen%}●"
42 42
 
43 43
 zstyle ':vcs_info:*:prompt:*' unstagedstr   "${FMT_UNSTAGED}"
44 44
 zstyle ':vcs_info:*:prompt:*' stagedstr     "${FMT_STAGED}"
... ...
@@ -68,9 +82,9 @@ function steeef_precmd {
68 68
     # check for untracked files or updated submodules, since vcs_info doesn't
69 69
     if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
70 70
         PR_GIT_UPDATE=1
71
-        FMT_BRANCH="(%{$fg[magenta]%}%b%u%c%{$fg[red]%}●${PR_RST})"
71
+        FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})"
72 72
     else
73
-        FMT_BRANCH="(%{$fg[magenta]%}%b%u%c${PR_RST})"
73
+        FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
74 74
     fi
75 75
     zstyle ':vcs_info:*:prompt:*' formats       "${FMT_BRANCH}"
76 76
 
... ...
@@ -82,5 +96,5 @@ function steeef_precmd {
82 82
 add-zsh-hook precmd steeef_precmd
83 83
 
84 84
 PROMPT=$'
85
-%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%} $vcs_info_msg_0_
85
+%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_
86 86
 $(virtualenv_info)$ '