Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Setting the 'completer' style — _match and **
- X-seq: zsh-users 21883
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Setting the 'completer' style — _match and **
- Date: Mon, 12 Sep 2016 23:30:28 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/zb+QfBLBRo1gUzL1GpqZT/UYLU=; b=g8UL8v X/lOblbd0/zbMKULviwbiqv4Jjy1KFnjgunhrmW7MGaWCKq/H7NA7bbqoyXMftd+ 6xnH243iqq8wRf+VwIhPnyuPm9KT3zSMAd4JKgCLPprW21UqSNxBM7yLgDM55gA0 KoV0qHuD+GMh75pHmHuYiBvCIyLbRfgN1EtQY=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=/zb+QfBLBRo1gUzL1GpqZT/UYLU=; b=uzSvG r/uiZQcvEMm30g89/zAidaOmqQ3OBE4m6Jm6odJEoiIOB0lfRS3WIEdKh1SQLuTz rTLZ7I1cnkMzTmVMdkzQdhsI+YxXYyMc+z7+OmekpalIW8vduF1WZQcflp6gvSkV JGsyuZLrAfIde7Kv6hHVCyrneaMrsvuLWNVBtQ=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author