Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there a way to do an automatic list-choices after successful completion of directory name?



On 7/9/06, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Jul 9,  8:37am, Nikolai Weibull wrote:

} Comments?

That technique only works in combination with this (or a similar) zstyle:

    zstyle :completion::complete:cd:: tag-order \
        local-directories path-directories

This fixes that, and also makes it work when completing files:

_expand-or-complete-with-list-choices-after-local-directories () {
 zle expand-or-complete
 if [[ $_lastcomp[tags] == ' '*(directories|files)' ' && $BUFFER[-1]
== '/' ]]; then
   zle list-choices
 fi
}

By the way, why is there a leading and trailing space in $_lastcomp[tags]?

 nikolai



Messages sorted by: Reverse Date, Date, Thread, Author