From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: zsh users <zsh-users@sunsite.dk>
Subject: Re: matching commands by pattern
Date: Fri, 13 Oct 2006 21:20:57 +0400 [thread overview]
Message-ID: <200610132121.01845.arvidjaar@newmail.ru> (raw)
In-Reply-To: <20061013104553.GJ4262@fsst.voodoo.lan>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 13 October 2006 14:45, Frank Terbeck wrote:
> Peter Stephenson <pws@csr.com>:
> > 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:
_all_matches
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)
iD8DBQFFL8r9R6LMutpd94wRAirFAKCgroYaPJPcQDiO4L69qMORmKkNQQCeMW9U
u9w4zgMfO26VH51uVuxCL18=
=JmGt
-----END PGP SIGNATURE-----
prev parent reply other threads:[~2006-10-13 17:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 9:04 Frank Terbeck
2006-10-13 9:30 ` Peter Stephenson
2006-10-13 10:45 ` Frank Terbeck
2006-10-13 17:20 ` Andrey Borzenkov [this message]
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=200610132121.01845.arvidjaar@newmail.ru \
--to=arvidjaar@newmail.ru \
--cc=zsh-users@sunsite.dk \
/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).