I'm tinkering around a bit with zsh.

Does anyone have something better than this for mutt command
completion?  (I don't like that sub-directories hack too much, but
it seems to be the only thing I get working.)

------------------------------

mutt_aliases=(`awk '/^alias/ { print $2; }' ~/.mutt/aliases`)

function mutt_folders {
        part="$(echo ${1}${2} | sed -e "s;^\+;${HOME}/Mail/;")"
        _reply=($(echo ${part}* 2> /dev/null))
        reply=()
        for f in $_reply ; do
                if [ -d $f ] ; then
                        reply=($reply $(echo $f/* 2> /dev/null ))
                elif [ -f $f ] ; then
                        reply=($reply $f)
                fi
        done
}

compctl -k mutt_aliases + -u \
        -x 's[+] c[-1,-f]' -K mutt_folders -U \
        - 's[-f],c[-1,-f]' -f   \
        - 's[-a],c[-1,-a]' -f   \
        -- mutt

------------------------------

Reply via email to