Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: String partial match from both left and right.
- X-seq: zsh-workers 43355
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Abhijeet Rastogi <abhijeet.1989@xxxxxxxxx>, <zsh-workers@xxxxxxx>
- Subject: Re: String partial match from both left and right.
- Date: Fri, 31 Aug 2018 12:01:27 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180831110130euoutp01b97b7ccab3ffbb5bec38910d4fe400ef~P8xnlWYHA0370903709euoutp01f
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535713290; bh=GP5WFmxIlYW0wf2tRAqR6zTiso3QuSBNt3gV5+fBiLw=; h=Date:From:To:Subject:In-Reply-To:References:From; b=WRIAcseAgZ08WYcr2IzS1Lo4CWEkg5hav27gU8tbdGlCxy9FD9Cu3I6T7O+aFVKIA DVU/S6h8bbMkuXfh4ulefGvyCF20NdUtHO4dYFJ3RM5coDckT124wnFK8RKT4OLT2f 6EWyR77i5c3KIT2OtCJeYFCsMfpPlHWf5MNMje8I=
- In-reply-to: <CACXxYfxO8Ws4+Tf-NqSZW9b7gP7opRiEY5Dtpm7ZABG1K0N6Lg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180831102508epcas4p4e1fdd60db2ae6336248268c887908f23@epcas4p4.samsung.com> <CACXxYfxO8Ws4+Tf-NqSZW9b7gP7opRiEY5Dtpm7ZABG1K0N6Lg@mail.gmail.com>
On Fri, 31 Aug 2018 15:54:02 +0530
Abhijeet Rastogi <abhijeet.1989@xxxxxxxxx> wrote:
> Hi everyone,
>
> I have this super simple zsh completion function.
>
> function hello() {
> arg=${@[1]}
> echo $arg
> }
> function _hello {
> _values -s ' ' 'dashboards' foo bar foo-bar
> }
> compdef _hello hello
>
> And what I want is, if I do:-
>
> $hello bar<TAB>
>
> I want `foo-bar` to come in the completion menu. I figured that it has
> something to do with mater-list but I can't seem to get it working.
>
> zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'l:|=*
> r:|=*'
(This should really got to zsh-users as it's not about implementation.)
Best I could come up with quickly was
zstyle ':completion:*:hello:*' matcher-list 'r:|-*'
where it works if you type "-b", i.e. you need the hyphen but not
anything before it.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author