zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Abhijeet Rastogi <abhijeet.1989@gmail.com>, <zsh-workers@zsh.org>
Subject: Re: String partial match from both left and right.
Date: Fri, 31 Aug 2018 12:01:27 +0100	[thread overview]
Message-ID: <20180831110129eucas1p2f29ef93fc4063d0dd117a871ea989012~P8xmQX9xg2697726977eucas1p2s@eucas1p2.samsung.com> (raw)
In-Reply-To: <CACXxYfxO8Ws4+Tf-NqSZW9b7gP7opRiEY5Dtpm7ZABG1K0N6Lg@mail.gmail.com>

On Fri, 31 Aug 2018 15:54:02 +0530
Abhijeet Rastogi <abhijeet.1989@gmail.com> 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


  reply	other threads:[~2018-08-31 11:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180831102508epcas4p4e1fdd60db2ae6336248268c887908f23@epcas4p4.samsung.com>
2018-08-31 10:24 ` Abhijeet Rastogi
2018-08-31 11:01   ` Peter Stephenson [this message]
2018-08-31 11:11   ` Oliver Kiddle
2018-09-02  4:37     ` Abhijeet Rastogi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20180831110129eucas1p2f29ef93fc4063d0dd117a871ea989012~P8xmQX9xg2697726977eucas1p2s@eucas1p2.samsung.com' \
    --to=p.stephenson@samsung.com \
    --cc=abhijeet.1989@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).