### vim:ft=zsh:foldmethod=marker
###
### old prompt
### my old prompt, not using promptinit, but works everywhere.
### no vcs_info support.
###
### Frank Terbeck <ft@bewatermyfriend.org>
### Last-Modified: Tue Nov 25 18:39:53 2008
###
### URI: <http://ft.bewatermyfriend.org/comp/zsh.html>
###
### simple prompt; i _love_ simplicity; (okay, it got a little colorful by now)
### well, it looks pretty messy at first sight.
###
### so, here we go:
###
### %(?..[%?]-) will display '[return-code]-' only if the last command returned non-zero
### %1(j.(j:%j%)-.) displays '(j: job-count)-' only if you got 1 or more background jobs running
### (%!)- always displays '(history number)-'
### %3~ displays the last 3 dirs you're in. eg. 'src/project-x.y.z/src' when you're in '/usr/src/project-x.y.z/src'
### %# '#' for root; '%' for regular users
###
### so the prompt may look like this:
### (12345)-/usr/src%
### [130]-(12345)-/usr/src%
### (j: 2)-(12345)-/usr/src%
### [130]-(j: 2)-(12345)-/usr/src%
###
### If I'm in a git repo, my prompt tells me about the currently checked out branch.
### (12345)-/usr/src [master]-%
# These are the pieces that are used to setup $PS1
P_RETVAL="%(?..${Pfg[wh]}${Pbg[red]}[%?]${PNC}-)"
P_JOBNUM="%1(j.(${Pfg[cy]}j: %j${PNC}%)-.)"
P_HISTEV="(${Pfg[red]}%!${PNC}%)"
P_SHPATH="${Pfg[ye]}%3~${PNC}"
# my prompt, heavily colored
Z_PROMPT="${P_RETVAL}${P_JOBNUM}${P_HISTEV}-${P_SHPATH}%# "
Z_OLD_PROMPT="${P_RETVAL}${P_HISTEV}-${P_SHPATH}%# "
# super simple
Z_SIMPLE_PROMPT="zsh%# "
### '%j' is only available in zsh 4.1+
if zis_41 "atleast" ; then
PROMPT=${Z_PROMPT}"${Pfg[cy]}"
: ${(qqq)PROMPT}
else
PROMPT="${Z_OLD_PROMPT}${Pfg[cy]}"
fi
(( ZHAVE_COLORS > 0 )) && POSTEDIT="${reset_color}"