zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Setting the 'completer' style — _match and **
Date: Mon, 12 Sep 2016 23:30:28 +0000	[thread overview]
Message-ID: <20160912233028.GA17257@fujitsu.shahaf.local2> (raw)

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


             reply	other threads:[~2016-09-12 23:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 23:30 Daniel Shahaf [this message]
2016-09-19 14:45 ` Setting the 'completer' style - " Bart Schaefer
     [not found] ` <160919074515.ZM28018__10595.0927398682$1474296416$gmane$org@torch.brasslantern.com>
2016-09-20  8:54   ` Daniel Shahaf
2016-09-20 15:46     ` Bart Schaefer

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=20160912233028.GA17257@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@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).