alias mdtest='swaks -s localhost -t'
-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
-
+ pdfextract() {
+ local i=$1
+ local o=$2
+ shift 2
+ pdftk "$i" cat "${@:-1-end}" output "${o%.pdf}.pdf"
+ }
+ compdef _files pdfextract
+
+ gittestfile() {
+ local annex; annex=false
+ local file
+
+ case "$1" in
+ (-a) annex=true;;
+ (*)
+ if [ -n "$file" ]; then
+ echo >&2 "E: filename already given"
+ return 1
+ fi
+ file="$1";;
+ esac
+
+ if [ -z "$file" ]; then
+ file=$(TMPDIR=${PWD} tempfile -ptest. -s.txt)
+ fi
+
+ echo "Test file created $(date)" >| $file
+
+ case "$annex" in
+ true)
+ git annex add $file
+ git commit -m"Add test file $file to annex"
+ ;;
+ false)
+ git add $file
+ git commit -m"Add test file $file"
+ ;;
+ esac
+ }
+
# vim:ft=zsh
# allow for better ad-hoc multiline editing
bindkey '\eq' push-line-or-edit
+# fixup ctrl-arrow stuff since it's all mucked up since zsh doesn't use readline
+bindkey "\e[1~" beginning-of-line
+bindkey "\e[4~" end-of-line
+bindkey "\e[5~" history-beginning-search-backward
+bindkey "\e[6~" history-beginning-search-forward
+bindkey "\e[3~" delete-char
+bindkey "\e[2~" quoted-insert
+bindkey "\e[5C" forward-word
+bindkey "\e[5D" backward-word
+bindkey "\e[1;5C" forward-word
+bindkey "\e[1;5D" backward-word
+
+# for rxvt
+bindkey "\e[8~" end-of-line
+bindkey "\eOc" forward-word
+bindkey "\eOd" backward-word
+ # fix home/end keys (for mosh)
+ bindkey "\e[7~" beginning-of-line
+ bindkey "\e[8~" end-of-line
# vim:ft=zsh