From: Don Armstrong Date: Sun, 21 Sep 2014 22:20:08 +0000 (-0700) Subject: Merge remote-tracking branch 'madduck/master' X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=inline;h=929a2738768030f0e46f3c13a26d9cde7cd38c62;p=zsh.git Merge remote-tracking branch 'madduck/master' Conflicts: .zsh/zshrc/30_aliases .zsh/zshrc/79_bindkeys --- 929a2738768030f0e46f3c13a26d9cde7cd38c62 diff --cc .zsh/zshrc/30_aliases index fa97378,7d48c0a..522fd4a --- a/.zsh/zshrc/30_aliases +++ b/.zsh/zshrc/30_aliases @@@ -197,4 -198,52 +199,44 @@@ compdef asc=ss 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 diff --cc .zsh/zshrc/79_bindkeys index 803db91,0284400..e3d3b3a --- a/.zsh/zshrc/79_bindkeys +++ b/.zsh/zshrc/79_bindkeys @@@ -21,21 -20,8 +21,24 @@@ bindkey '\e=' copy-prev-shell-wor # 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