zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Setting the 'completer' style - _match and **
Date: Mon, 19 Sep 2016 07:45:15 -0700	[thread overview]
Message-ID: <160919074515.ZM28018@torch.brasslantern.com> (raw)
In-Reply-To: <20160912233028.GA17257@fujitsu.shahaf.local2>

On Sep 12, 11:30pm, Daniel Shahaf wrote:
} 
} 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?

You could probably come up with a "zstyle -e" formulation that would only
include_match in the completer value in the right circurmstances.  I'm not
sure that's a better solution than yours.

I'll note in passing that _match is supposed to be used after _complete,
not before _expand. Might it be better to suppress the _expand completer
in the cases where you want _match rather than the other way around?


  reply	other threads:[~2016-09-19 14:45 UTC|newest]

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