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

Re: completion oddity

On Mon, May 21, 2012 at 07:42:32PM -0700, Bart Schaefer wrote:

> If you want to treat the hyphenated strings as single words rather
> than as compound words, then you have to do something not entirely
> obvious, which is to override the default "matcher" used when creating
> the internal representation of the _arguments specifications.  You do
> this like so:
>     _k () { _arguments -M '' --r1-word --really-r1-word }
> The empty string there turns off matching.

Wonderful.  I'll have to spend some time tomorrow figuring out exactly how
I want to deal with this.  While your explanation makes sense to me, I'm
not sure that it's a natural behavior, or that I could convince anyone else
of it.  I'm tempted to just put -M "" in where needed, but I kinda like the
idea of the multiple partial-word matching, even if it'd never occurred to
me to try it before myself.

I did a quick test with the matcher-list zstyle, though, but couldn't get
it to work (without the -M "" in _k).  I tried both

    zstyle ":completion::complete:k::" matcher-list ""
    zstyle ":completion:*" matcher-list ""

(the first being the string I get when executing _complete_help, and the
second just being super-inclusive) but after both, I got the original
behavior.  I also tried "matcher", but no dice.  Any help here would be


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