ABBREVFILE=/tmp/script-$USER if [[ $SCRIPT = 1 ]]; then if [[ ! $screen = 1 ]]; then screen=1 screen; exit fi else umask 0077; SCRIPT=1 script -f -a $ABBREVFILE-$WINDOWID; rm $ABBREVFILE-$WINDOWID; exit fi
alias cutesc="sed -e 's/\([^a-zA-Z]*\([a-zA-Z]\|$\)\)\+/ /g' | col -b" comp_dabbrev_display () { local i c reply for i in $ABBREVFILE*; do c=($(tail -100 $i | head -99 | cutesc)) reply=("$reply[@]" "$c[@]") done compadd - "$reply[@]" } zle -C dabbrev-complete menu-complete comp_dabbrev_display bindkey '^[/' dabbrev-complete