+# -*- mode: sh -*-
# zshrc/30_aliases
#
# Defines command shortcuts
alias lsd='ll -d *(-/DN)'
alias lscontext=ls
-cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
+#cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
#_cd_l() { ll }
#chpwd_functions+=_cd_l
alias mbug='bts show --mbox'
alias bug='BROWSER=www-browser bts show'
-# handy documentation lookup on Debian
-# from http://www.michael-prokop.at/computer/config/.zshrc
+edalias() {
+ [[ -z "$1" ]] && { echo "Usage: edalias <alias_to_edit>" ; return 1 } || vared aliases'[$1]' ;
+}
+compdef _aliases edalias
+
+edfunc() {
+ [[ -z "$1" ]] && { echo "Usage: edfunc <function_to_edit>" ; return 1 } || zed -f "$1" ;
+}
+compdef _functions edfunc
+
doc() { cd /usr/share/doc/$1 }
compdef '_files -W /usr/share/doc -/' doc
function psgrep() { ps aux | grep "[${1[1]}]${1[2,-1]}" }
+alias rw-='chmod 600'
+alias rwx='chmod 700'
+alias r--='chmod 644'
+alias r-x='chmod 755'
+alias r-s='chmod 2755'
+alias rws='chmod 2775'
+
alias bofh='fortune bofh-excuses'
autoload -U baseconv
alias dpkg-buildpackage="dpkg-buildpackage -k$DEBKEYID -rfakeroot"
-bugsub() { echo X-debbugs-autosubscribe: madduck | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
+bugsub() { echo X-debbugs-autosubscribe: don | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
bugunsub() { sendmail -f $DEBEMAIL ${1:?No bug number}-unsubscribe@bugs.debian.org </dev/null }
ptssub() { echo subscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
ptsunsub() { echo unsubscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
alias btd='btdownloadheadless'
-alias mdtest='swaks -s localhost -t'
+function asc () { autossh -t "$@" 'screen -qxp= || screen -qdRR' }
+compdef asc=ssh
-if whence devtodo >/dev/null; then
- _devtodo_on_chpwd() {
- local out; out="$(devtodo)"
- [[ -n $out ]] && print "todo:\n$out"
- }
- [[ -z ${(M)chpwd_functions:#_devtodo_on_chpwd} ]] && chpwd_functions+=_devtodo_on_chpwd
-fi
+alias mdtest='swaks -s localhost -t'
# vim:ft=zsh