# This file comes from http://www.davidfaure.fr/scripts/zsh/zprompting

# http://stackoverflow.com/questions/1128496/to-get-a-prompt-which-indicates-git-branch-in-zsh

setopt prompt_subst
autoload -Uz vcs_info
zstyle ':vcs_info:*' actionformats \
    '%F{5}(%F{2}%b%F{3}|%F{1}%a%F{5})%f '
zstyle ':vcs_info:*' formats       \
    '%F{5}(%F{2}%b%F{5})%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'

zstyle ':vcs_info:*' enable git cvs svn bzr

# or use pre_cmd, see man zshcontrib
vcs_info_wrapper() {
  vcs_info 2>/dev/null
  if [ -n "$vcs_info_msg_0_" ]; then
      echo " ${vcs_info_msg_0_}$del"
  fi
}

if [ "$UID" = "0" ] ; then
  PROMPT="-`hostname`- %F{red}"'%n%f %T %~%(?,, [%?])'$'$(vcs_info_wrapper)>'
else
  PROMPT="-`hostname`- "'%n %T %~%(?,, [%?])'$'$(vcs_info_wrapper)>'
fi
export PROMPT

# Old, simple version:
#export PROMPT="-`hostname`- %n %T %~>"

# Another option:
#export RPROMPT='%B%d%b %t '
#export PROMPT='%B%n@%m %#%b '
