All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 # Defines command shortcuts
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
8 # Source repository: git://git.madduck.net/etc/zsh.git
11 function trace() { eval "set -x; $@" }
13 alias mv='nocorrect mv'
14 alias cp='nocorrect cp'
15 alias ln='nocorrect ln'
16 alias mkdir='nocorrect mkdir'
17 alias rm='nocorrect rm'
19 alias find='noglob find'
20 alias w3m='noglob w3m -no-mouse'
21 alias links='noglob links'
22 alias wb='noglob www-browser'
23 alias wget='noglob wget'
24 alias curl='noglob curl'
25 alias apt-cache='noglob apt-cache'
26 alias locate='noglob locate'
28 local _USER_AGENT="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2)"
29 alias swget="noglob wget --user-agent='$USER_AGENT'"
31 typeset -a _ls_opts; _ls_opts=(-bC --color=auto)
32 command ls --group-directories-first >/dev/null 2>&1 \
33 && _ls_opts+=--group-directories-first
34 # I prefer POSIX collation for ls
35 alias ls="LC_COLLATE=POSIX ls $_ls_opts"
37 alias l='ls --time-style=+%Y%m%d.%H%M -gG'
45 # List only directories and symbolic links that point to directories
46 alias lsd='ll -d *(-/DN)'
49 cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
51 #chpwd_functions+=_cd_l
56 alias egrep='egrep --color=auto -d skip'
57 alias fgrep='fgrep --color=auto -d skip'
58 alias grep='grep --color=auto -d skip'
60 alias mmv='noglob zmv -W'
63 alias zgmv='zmv -p git-mv'
68 alias mbug='bts show --mbox'
69 alias bug='BROWSER=www-browser bts show'
71 # handy documentation lookup on Debian
72 # from http://www.michael-prokop.at/computer/config/.zshrc
73 doc() { cd /usr/share/doc/$1 }
74 compdef '_files -W /usr/share/doc -/' doc
76 alias giti='git init && git add . && git commit -minitial\ checkin && git tag orig'
78 if whence mtail >/dev/null; then
80 elif whence tailf >/dev/null; then
87 function ltail() { t ~log/$1 }
88 compdef '_files -W ~log' ltail
90 function lless() { sensible-pager ~log/$1 }
91 compdef '_files -W ~log' lless
93 alias tsl='ltail syslog'
94 alias lsl='lless syslog'
95 alias tml='ltail mail.log'
96 alias lml='lless mail.log'
97 alias tal='ltail auth.log'
98 alias lal='lless auth.log'
99 alias tdl='ltail daemon.log'
100 alias ldl='lless daemon.log'
101 alias tkl='ltail kern.log'
102 alias lkl='lless kern.log'
105 local pattern="$1"; shift
106 eval egrep "'$pattern'" "~log/${(j: ~log/:)@}"
110 alias mps='ps -ao user,pcpu,start,command'
112 function of() { lsof -np "$1" }
115 function psgrep() { ps aux | grep "[${1[1]}]${1[2,-1]}" }
117 alias bofh='fortune bofh-excuses'
120 alias b2d='baseconv 2 10'
121 alias d2b='baseconv 10 2'
122 alias d2h='baseconv 10 16'
123 alias h2d='baseconv 16 10'
124 alias d2o='baseconv 10 8'
125 alias d2o='baseconv 10 8'
126 alias h2b='baseconv 16 2'
127 alias b2h='baseconv 2 16'
129 alias sendmail=/usr/sbin/sendmail
132 d() { _d $* | sensible-pager }
133 the() { d -d moby-thesaurus $* }
134 typeset -A _LANGUAGES
141 for l0 in ${(k)_LANGUAGES}; do
142 for l1 in ${(k)_LANGUAGES}; do
143 eval "function _${l0}-${l1}() { _d -d fd-${_LANGUAGES[$l0]}-${_LANGUAGES[$l1]} \$* }"
144 eval "function ${l0}-${l1}() { d -d fd-${_LANGUAGES[$l0]}-${_LANGUAGES[$l1]} \$* }"
147 unset '_LANGUAGES[en]'
148 for l in ${(k)_LANGUAGES}; do
149 eval "function ${l}() { (_${l}-en \$*; _en-${l} \$*) | more }"
153 alias dpkg-buildpackage="dpkg-buildpackage -k$DEBKEYID -rfakeroot"
155 bugsub() { echo X-debbugs-autosubscribe: madduck | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
156 bugunsub() { sendmail -f $DEBEMAIL ${1:?No bug number}-unsubscribe@bugs.debian.org </dev/null }
157 ptssub() { echo subscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
158 ptsunsub() { echo unsubscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
159 qasub() { echo subscribe ${1:?E: no package name given.} ${2:-unspecifed} | sendmail -f $DEBEMAIL ddpo@qa.debian.org }
160 qaunsub() { echo unsubscribe ${1:?E: no package name given.} ${2:-unspecifed} | sendmail -f $DEBEMAIL ddpo@qa.debian.org }
162 uc() { unicode --max=0 --colour=off "$@" | sensible-pager }
168 alias btd='btdownloadheadless'
170 alias mdtest='swaks -s localhost -t'
172 if whence devtodo >/dev/null; then
173 _devtodo_on_chpwd() {
174 local out; out="$(devtodo)"
175 [[ -n $out ]] && print "todo:\n$out"
177 [[ -z ${(M)chpwd_functions:#_devtodo_on_chpwd} ]] && chpwd_functions+=_devtodo_on_chpwd