Zsh Mailing List Archive
Messages sorted by:
Re: matching commands by pattern
- X-seq: zsh-users 10867
- From: Andrey Borzenkov <arvidjaar@xxxxxxxxxx>
- To: zsh users <zsh-users@xxxxxxxxxx>
- Subject: Re: matching commands by pattern
- Date: Fri, 13 Oct 2006 21:20:57 +0400
- In-reply-to: <20061013104553.GJ4262@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20061013090422.GH4262@xxxxxxxxxxxxxxx> <200610130930.k9D9UuL7007021@xxxxxxxxxxxxxx> <20061013104553.GJ4262@xxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
On Friday 13 October 2006 14:45, Frank Terbeck wrote:
> Peter Stephenson <pws@xxxxxxx>:
> > Frank Terbeck wrote:
> > > I'm trying to be able to use compsys to find all completions, that are
> > > possible as the first word of the command-line _and_ match a given
> > > pattern. Ideally, these matches should be accessible via a completion
> > > menu.
> > It's easy: just set the option "globcomplete", that's what it's designed
> > for. This makes pattern characters active during normal completion, so
> > you don't have to do anything else special to get command completion in
> > command position.
wow, I did not even know this one exists :)
Personally I'm using these completers:
zstyle ':completion:*' completer _oldlist _complete _match
and it does the same, but with added bonus that all other goodies (like
matchers) work too.
> Thank you, Peter.
> This works. But it this way, glob_complete is in effect for every glob
> on the command-line when trying to complete.
> % ls *.txt<TAB>
> drops into a menu, rather than expanding the glob into .txt files.
Well, you can always expand using expand-word (I believe, by default bound to
^X*). Or you could add _all_matches completer, see man page:
This completer can be used to add a string consisting of all other
matches. As it influences later completers it must appear as the
first completer in the list. The list of all matches is affected
by the avoid-completer and old-matches styles described above.
So you have choice to include either all generated matches or only part
thereof. It really is more flexible than old way.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
-----END PGP SIGNATURE-----
Messages sorted by: