Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Setting the 'completer' style - _match and **
- X-seq: zsh-users 21948
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Setting the 'completer' style - _match and **
- Date: Mon, 19 Sep 2016 07:45:15 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=wN0VTyjj+HgPelx6jmcUK8I+LEBq1m/6us0HX9YiExY=; b=xzxhdJxXv6N1SIa5aPTYHguDDAAwhBgjukRJXGI+finl3DawwoV0nc76S0zTKxvcIn 3GJjkIuCpQFVXK38UY/R0PMh/ubyol7aUxQon5ufzeO7rSNKC3PtbfsgmYZnZmQXtQDn CtnFKrRkgKv7U7nnL/b1GNd/8z570vx0qcLH9VkZMM08SB99D3TGFlZNbsKyhnR8QGQH IZ4eOmiLIDZB7e0F3b44md+2oyqIv4OknJBY991gEcoGJhZNyk2g550gn66MepIkUYyA PV4QRNvW209zygB9Ua6ltdi5YiW+EgAN3POPjzvtUTOxQDluupzNAIbzb39PoCUsLMDW 3shQ==
- In-reply-to: <20160912233028.GA17257@fujitsu.shahaf.local2>
- 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
- References: <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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author