3 ## User-defined functions
7 \
which -p $1 >/dev
/null
2>&1
13 my_color
=${2-"$prompt_colors[generic]"}
16 for i
in {1..$
((74 - ${#1} - 5))}; do
21 if [ "$1" != "" ]; then
22 print
-Pn "${C_}$my_color;1${_C}${hbar}$T_$_t_u$_T${C_}0;$my_color${_C} $1 ${C_}0;$my_color;1${_C}$T_$_t_t$_t_q$_T\r${C_}0${_C}"
24 print
-Pn "${C_}$my_color;1${_C}${hbar}$T_$_t_q$_t_q$_t_q$_t_q$_t_q$_T${C_}0${_C}"
30 if [ -e /etc
/login.defs
]; then
31 eval `grep -v '^[$#]' /etc/login.defs | grep "^UID_" | tr -d '[:blank:]' | sed 's/^[A-Z_]\+/&=/'`
32 [ \
( $UID -ge $UID_MIN \
) ]
34 [ "`whoami`" != "root" ]
45 if ( cmd_exists git
&& test -d .git
); then
46 # Shows tracked branches and modified files
47 git checkout HEAD
2>&1 |
sed 's/^/ /'
52 add-zsh-hook chpwd _jj_chpwd
59 # Taken from oh-my-zsh
61 function dirpersiststore
() {
62 dirs -p | perl
-e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' >|
$zdirstore
64 add-zsh-hook zshexit dirpersiststore
66 function dirpersistrestore
() {
67 if [ -f $zdirstore ]; then