# -*- sh -*-
#
+is_root() {
+ test ${EUID:?} -eq 0
+}
+
+sourcedir() {
+ set -x
+ if [ ! -d "$1" ]; then
+ echo "no such directory: $1"
+ return 1
+ fi
+ for f in "$1"/*(.N,@N); do
+ case "$f" in
+ *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
+ esac
+ echo " sourcing file $f"
+ source "$f"
+ done
+}
+
+_DIR=$HOME/${(%):-%1N}.d
+sourcedir $_DIR
+
alias mv='nocorrect mv' # no spelling correction on mv
alias cp='nocorrect cp' # no spelling correction on cp
alias mkdir='nocorrect mkdir' # no spelling correction on mkdir
alias ssh='ssh-add -l > /dev/null 2>&1 || ssh-add ; \ssh'
-
bindkey -e # Emacs-style commandline editing
-PROMPT=": %U%n@%m%u${CHROOT} %B%30<..<%~%b %(!.#.>) "
+PROMPT=': %(!.%F{red}.)%U%n@%m%u%(!.%f.)'${CHROOT}' ${vcs_info_msg_0_}%B%30<..<%~%b %(!.#.>) '
case `uname -s` in
"FreeBSD")
--- /dev/null
+#
+# 60_vcsprompt
+#
+#
+#
+
+setopt PROMPT_SUBST
+autoload -Uz vcs_info
+zstyle ':vcs_info:*' actionformats \
+ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
+zstyle ':vcs_info:*' formats \
+ '%F{5}(%f%s%F{5})%F{3}-%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 svn
+typeset -ga precmd_functions
+precmd_functions+=vcs_info