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

Setting the 'completer' style — _match and **



I'm trying to configure my zshrc such that:

1. The following —
.
    % mkdir -p html/generic.5.html man/man5/generic.5
    % : **/generic.*<TAB>
.
— offers both directories.

2. The following —
.
	% mkdir nntp-gmane
	% service *ntp*<TAB>
.
— offers "openntpd" but not "nntp-gmane".

I've come up with the following:
.
    bindkey $'\t' complete-word
    zstyle ':completion:*' completer _all_matches _match-ds _expand _complete _ignored
    _match-ds() {
      [[ $PREFIX$SUFFIX != *[*][*]* ]] && _match "$@"
    }
.
The idea is that if a pattern contains "**" then _match('s wrapper) will
leave it for _expand to process.

Is there another way to implement this?

Cheers,

Daniel



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