1 # ZSH Theme - Preview: http://dl.dropbox.com/u/4109351/pics/gnzh-zsh-theme.png
 
   5 autoload -U colors zsh/terminfo # Used in the colour alias below
 
   9 # make some aliases for the colours: (coud use normal escap.seq's too)
 
  10 for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
 
  11   eval PR_$color='%{$fg[${(L)color}]%}'
 
  13 eval PR_NO_COLOR="%{$terminfo[sgr0]%}"
 
  14 eval PR_BOLD="%{$terminfo[bold]%}"
 
  17 if [[ $UID -ge 1000 ]]; then # normal user
 
  18   eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}'
 
  19   eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
 
  20   local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR'
 
  21 elif [[ $UID -eq 0 ]]; then # root
 
  22   eval PR_USER='${PR_RED}%n${PR_NO_COLOR}'
 
  23   eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}'
 
  24   local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR'
 
  27 # Check if we are on SSH or not
 
  28 if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then 
 
  29   eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH
 
  31   eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH
 
  34 local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
 
  36 local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}'
 
  37 local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}'
 
  39 if which rvm-prompt &> /dev/null; then
 
  40   rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
 
  42   if which rbenv &> /dev/null; then
 
  43     rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}'
 
  46 local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}'
 
  48 #PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT "
 
  49 PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
 
  53 ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹"
 
  54 ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$PR_NO_COLOR%}"