# Source repository: git://git.madduck.net/etc/zsh.git
#
+function trace() { eval "set -x; $@" }
+
alias mv='nocorrect mv'
alias cp='nocorrect cp'
alias ln='nocorrect ln'
# handy documentation lookup on Debian
# from http://www.michael-prokop.at/computer/config/.zshrc
-doc() { cd /usr/share/doc/$1 && ls }
-_doc() { _files -W /usr/share/doc -/ }
-compdef _doc doc
+doc() { cd /usr/share/doc/$1 }
+compdef '_files -W /usr/share/doc -/' doc
alias giti='git init && git add . && git commit -minitial\ checkin && git tag orig'
else
alias t='tail -f'
fi
-alias tsl='t /var/log/syslog'
-alias lsl='sensible-pager /var/log/syslog'
-alias tml='t /var/log/mail.log'
-alias lml='sensible-pager /var/log/mail.log'
-alias tal='t /var/log/auth.log'
-alias lal='sensible-pager /var/log/auth.log'
-alias tdl='t /var/log/daemon.log'
-alias ldl='sensible-pager /var/log/daemon.log'
-alias tkl='t /var/log/kern.log'
-alias lkl='sensible-pager /var/log/kern.log'
+compdef _files t
+
+function ltail() { t ~log/$1 }
+compdef '_files -W ~log' ltail
+
+function lless() { sensible-pager ~log/$1 }
+compdef '_files -W ~log' lless
+
+alias tsl='ltail syslog'
+alias lsl='lless ~log/syslog'
+alias tml='ltail mail.log'
+alias lml='lless ~log/mail.log'
+alias tal='ltail auth.log'
+alias lal='lless ~log/auth.log'
+alias tdl='ltail daemon.log'
+alias ldl='lless ~log/daemon.log'
+alias tkl='ltail kern.log'
+alias lkl='lless ~log/kern.log'
+
+function lgrep() {
+ local pattern="$1"; shift
+ eval egrep "'$pattern'" "~log/${(j: ~log/:)@}"
+}
alias px='ps afux'
alias mps='ps -ao user,pcpu,start,command'
alias mdtest='swaks -s localhost -t'
if whence devtodo >/dev/null; then
- _devtodo_on_chpwd() {
+ _devtodo_on_chpwd() {
local out; out="$(devtodo)"
[[ -n $out ]] && print "todo:\n$out"
}
- chpwd_functions+=_devtodo_on_chpwd
+ [[ -z ${(M)chpwd_functions:#_devtodo_on_chpwd} ]] && chpwd_functions+=_devtodo_on_chpwd
fi
# vim:ft=zsh