2010-06-27 01:12:01 +10:00
|
|
|
|
function prompt_color() {
|
2010-06-27 01:37:43 +10:00
|
|
|
|
if [ "$USER" = "root" ]; then
|
2010-06-27 01:12:01 +10:00
|
|
|
|
echo "red"
|
|
|
|
|
else
|
2010-06-27 15:31:31 +10:00
|
|
|
|
if [ -n "$SSH_TTY" ]; then
|
|
|
|
|
echo "blue"
|
|
|
|
|
else
|
|
|
|
|
echo "green"
|
|
|
|
|
fi
|
2010-06-27 01:12:01 +10:00
|
|
|
|
fi
|
|
|
|
|
}
|
2010-06-25 17:02:29 +10:00
|
|
|
|
|
2010-06-28 09:08:35 +10:00
|
|
|
|
function prompt_char {
|
|
|
|
|
git branch >/dev/null 2>/dev/null && echo '±' && return
|
|
|
|
|
hg root >/dev/null 2>/dev/null && echo '☿' && return
|
|
|
|
|
# echo '○'
|
|
|
|
|
echo '♪'
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-27 01:37:43 +10:00
|
|
|
|
# Prompts
|
2010-06-27 01:12:01 +10:00
|
|
|
|
ZSH_THEME_VCS_PROMPT_PREFIX="%{$fg[red]%}‹"
|
|
|
|
|
ZSH_THEME_VCS_PROMPT_SUFFIX="›%{$reset_color%}"
|
|
|
|
|
ZSH_THEME_VCS_PROMPT_FORMAT="${ZSH_THEME_VCS_PROMPT_PREFIX}%b:%h${ZSH_THEME_VCS_PROMPT_SUFFIX}"
|
2010-06-25 17:02:29 +10:00
|
|
|
|
|
2010-06-28 09:08:35 +10:00
|
|
|
|
PS1='%{$fg[blue]%}$(prompt_pwd)%{$reset_color%} %{$fg[$(prompt_color)]%}$(prompt_char)%{$reset_color%} '
|
2010-06-27 23:53:00 +10:00
|
|
|
|
RPS1='$(${VCPROMPT} -f ${ZSH_THEME_VCS_PROMPT_FORMAT})'
|