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–2017 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
8 # Source repository: http://git.madduck.net/v/etc/zsh.git
11 alias giti='git init && git add . && git commit -minitial\ checkin && git tag orig'
13 local branch; branch="$(git symbolic-ref -q HEAD)"; branch="${branch##*/}"
14 git config branch.${branch}.remote ${1:-origin}
15 git config branch.${branch}.merge refs/heads/${branch}
16 git config branch.${branch}.rebase true
19 if whence mtail >/dev/null; then
21 elif whence tailf >/dev/null; then
28 function ltail() { t ~log/$1 }
29 compdef '_files -W ~log' ltail
31 function lless() { sensible-pager ~log/$1 }
32 compdef '_files -W ~log' lless
34 alias tsl='ltail syslog'
35 alias lsl='lless syslog'
36 alias tml='ltail mail.log'
37 alias lml='lless mail.log'
38 alias tal='ltail auth.log'
39 alias lal='lless auth.log'
40 alias tdl='ltail daemon.log'
41 alias ldl='lless daemon.log'
42 alias tkl='ltail kern.log'
43 alias lkl='lless kern.log'
46 local pattern="$1"; shift
47 eval egrep "'$pattern'" "~log/${(j: ~log/:)@}"
50 function psgrep() { ps aux | grep "[${1[1]}]${1[2,-1]}" }
52 alias sendmail=/usr/sbin/sendmail
55 d() { _d $* | sensible-pager }
56 the() { d -d moby-thesaurus $* }
64 for l0 in ${(k)_LANGUAGES}; do
65 for l1 in ${(k)_LANGUAGES}; do
66 eval "function _${l0}-${l1}() { _d -d fd-${_LANGUAGES[$l0]}-${_LANGUAGES[$l1]} \$* }"
67 eval "function ${l0}-${l1}() { d -d fd-${_LANGUAGES[$l0]}-${_LANGUAGES[$l1]} \$* }"
70 unset '_LANGUAGES[en]'
71 for l in ${(k)_LANGUAGES}; do
72 eval "function ${l}() { (_${l}-en \$*; _en-${l} \$*) | more }"
76 bugsub() { echo X-debbugs-autosubscribe: madduck | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
77 bugunsub() { sendmail -f $DEBEMAIL ${1:?No bug number}-unsubscribe@bugs.debian.org </dev/null }
78 ptssub() { echo subscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
79 ptsunsub() { echo unsubscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
80 qasub() { echo subscribe ${1:?E: no package name given.} ${2:-unspecifed} | sendmail -f $DEBEMAIL ddpo@qa.debian.org }
81 qaunsub() { echo unsubscribe ${1:?E: no package name given.} ${2:-unspecifed} | sendmail -f $DEBEMAIL ddpo@qa.debian.org }
82 listsub() { echo Subject: subscribe | sendmail -f ${1%@*}=${1#*@}@mass.madduck.net ${1%@*}-request@${1#*@} }
83 listunsub() { echo Subject: unsubscribe | sendmail -f ${1%@*}=${1#*@}@mass.madduck.net ${1%@*}-request@${1#*@} }
85 uc() { unicode --max=0 --colour=off "$@" | sensible-pager }
91 alias btd='btdownloadheadless'
93 function asc () { autossh -t "$@" 'screen -qxp= || screen -qdRR' }
96 alias mdtest='swaks -s localhost -t'
98 if whence devtodo >/dev/null; then
100 local out; out="$(devtodo)"
101 [[ -n $out ]] && print "todo:\n$out"
103 [[ -z ${(M)chpwd_functions:#_devtodo_on_chpwd} ]] && chpwd_functions+=_devtodo_on_chpwd
110 pdftk "$i" cat "${@:-1-end}" output "${o%.pdf}.pdf"
113 tmpfile=$(tempfile -p pdftk -s .pdf)
114 cleanup() { rm -f $tmpfile; trap - EXIT; }
116 pdftk "$i" cat "1-end~${(j:~:)@}" output $tmpfile
121 compdef _files pdfextract
124 local annex; annex=false
130 if [ -n "$file" ]; then
131 echo >&2 "E: filename already given"
137 if [ -z "$file" ]; then
138 file=$(TMPDIR=${PWD} tempfile -ptest. -s.txt)
141 echo "Test file created $(date)" >| $file
146 git commit -m"Add test file $file to annex"
150 git commit -m"Add test file $file"