# Source repository: http://git.madduck.net/v/etc/zsh.git
#
-. $ZDOTDIR/logging
-. $ZDOTDIR/util
-
if [[ -o rcs ]]; then
+ source $ZDOTDIR/logging
+ source $ZDOTDIR/util
+ source $ZDOTDIR/sourcedir
+
# __do_debug && set -x || :
- file="%1N"; file="${(%)file}"
- . $ZDOTDIR/sourcedir
- sourcedir $ZDOTDIR/${file#.}
+ _DIR=$ZDOTDIR/${${(%):-%1N}#.}
+ sourcedir $_DIR
+
+ if [[ -d $_DIR/parts.d ]]; then
+ sourcedir $_DIR/parts.d
+ fi
+
+ unset _DIR
# __do_debug && set +x || :
fi
sourcedir() {
if [ ! -d "$1" ]; then
+ error "no such directory: $1"
return 1
fi
# debug "sourcing directory ${1#$ZDOTDIR/}"
*~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
esac
# debug " sourcing file $f"
- . "$f"
+ source "$f"
done
}
if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then
rm -f $ZDOTDIR/**/*.zwc{,.old}(D.N)
- for f ($ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.)) \
- [[ $f:t != .gitignore ]] && zcompile $f
+ for f in $ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.); do
+ case "$f:t" in
+ .gitignore|.*.sw?) continue;;
+ esac
+ zcompile $f
+ done
fi
if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then
rm -f $ZVARDIR/**/*.zwc{,.old}(.N)
- for f ($ZVARDIR/comp*(.N)) zcompile $f
+ for f in $ZVARDIR/comp*(.N); do
+ case "$f:t" in
+ .gitignore|.*.sw?) continue;;
+ esac
+ zcompile $f
+ done
fi
# vim:ft=zsh
# Source repository: http://git.madduck.net/v/etc/zsh.git
#
-zrecompile $ZDOTDIR/**(N) $ZVARDIR/**(N) | while read pre file post; do
+zrecompile $ZDOTDIR/**/*(/N) $ZVARDIR/**/*(/N) | while read pre file post; do
case "$post" in
succeeded*) rm -f "${file%:}".old;;
*) :;;
zstyle ':completion:*:(all-|)files' ignored-patterns \
'*.bk' '*.bak' '*.old' '*~' '.*.sw?'
-# populate hosts completion with SSH's known_hosts
-local _myhosts
-_myhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
-zstyle ':completion:*' hosts $_myhosts
-
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) numeric )'
#zstyle ':completion:*' list-suffixes true
alias d2o='baseconv 10 8'
alias o2d='baseconv 8 10'
-alias sshnew='ssh -o "StrictHostKeyChecking no"'
-alias scpnew='scp -o "StrictHostKeyChecking no"'
-alias sshtmp='sshnew -o "UserKnownHostsFile /dev/null"'
-alias scptmp='scpnew -o "UserKnownHostsFile /dev/null"'
-
alias sendmail=/usr/sbin/sendmail
_d() { dict $* }
local dir
while true; do
[ -d ${dir}.git ] && echo git && break
+ [ -d "$GIT_DIR" ] && echo git && break
[ -d ${dir}.bzr ] && echo bzr && break
[ -d ${dir}.hg ] && echo hg && break
[ "$(readlink -f ${dir:-.})" = / ] && echo NONE && break
branch="$(__git_get_branch)" ||
{ error "could not determine git branch"; return 1 }
eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
- [ -d "$GIT_DIR" ] && set -- "$GIT_DIR" "$2" "$1"
+ if [ -d "$GIT_DIR" ]; then
+ # poor man's replace until I find out how to do named dirs properly
+ # here:
+ _D="${GIT_DIR/$HOME/~}"
+ set -- "$_D" "$2" "${${1#$_D}%/}"
+ unset _D
+ fi
;;
hg)
reporoot="$(__hg_get_reporoot)" ||
typeset -la rmfiles
-_OLDPWD="$PWD"
-builtin cd ~
-
-rmfiles+=plugin131.trace
-rmfiles+=minicom.log
-rmfiles+=.cshrc
-rmfiles+=java.log.*(N)
-rmfiles+=unison.log
-rmfiles+=.bzr.log
-rmfiles+=.fonts.cache-1
-rmfiles+=.gksu.lock
-rmfiles+=.*.sw[mnop](N)
-rmfiles+=.viminfo
-rmfiles+=.bash_history
-rmfiles+=core
-rmfiles+=nohup.out
-rmfiles+=typescript
+rmfiles+=~/plugin131.trace
+rmfiles+=~/minicom.log
+rmfiles+=~/.cshrc
+rmfiles+=~/java.log.*(N)
+rmfiles+=~/unison.log
+rmfiles+=~/.bzr.log
+rmfiles+=~/.fonts.cache-1
+rmfiles+=~/.gksu.lock
+rmfiles+=~/.*.sw[mnop](N)
+rmfiles+=~/.viminfo
+rmfiles+=~/.bash_history
+rmfiles+=~/core
+rmfiles+=~/nohup.out
+rmfiles+=~/typescript
typeset -la _rmfiles
unset rmfiles
if [[ -n $_rmfiles ]]; then
- info "Removing files: ${_rmfiles[@]}..."
+ info "Removing files: ${(j: :)${_rmfiles#$HOME/}}..."
rm -f ${_rmfiles[@]}
fi
unset _rmfiles
-builtin cd $_OLDPWD
-unset _OLDPWD
-
# vim:ft=zsh