zsh-users
 help / color / mirror / code / Atom feed
* Setting the 'completer' style — _match and **
@ 2016-09-12 23:30 Daniel Shahaf
  2016-09-19 14:45 ` Setting the 'completer' style - " Bart Schaefer
       [not found] ` <160919074515.ZM28018__10595.0927398682$1474296416$gmane$org@torch.brasslantern.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Shahaf @ 2016-09-12 23:30 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-20 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 23:30 Setting the 'completer' style — _match and ** Daniel Shahaf
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

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).