zsh-users
 help / color / mirror / code / Atom feed
* Expand from completion
@ 2003-04-22 10:52 GoTaR
  2003-04-22 12:30 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: GoTaR @ 2003-04-22 10:52 UTC (permalink / raw)
  To: zsh-users

Hi!

I don't remember if I asked it allready, but there is new version
coming, so maybe once more: how to expand sth like this:

~: rpm -qi *devel*[tab]
RPM package
ORBit-devel-0.5.17-2                  esound-devel-0.2.29-1      libstdc++-devel-3.2.2-0.5
SDL-devel-1.2.5-4                     expat-devel-1.95.6-2       libtiff-devel-3.6.0-0.beta.1
[...]

? I'd like to bring all matches to command line:

~: rpm -qi ORBit-devel-0.5.17-2 SDL-devel-1.2.5-4 \
	esound-devel-0.2.29-1 expat-devel-1.95.6-2 \
	libstdc++-devel-3.2.2-0.5 libtiff-devel-3.6.0-0.beta.1 [...]

For files it works with ^x-* (or with some style/sth with tab).

-- 
GoTaR <priv0.onet.pl->gotar>
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Expand from completion
  2003-04-22 10:52 Expand from completion GoTaR
@ 2003-04-22 12:30 ` Oliver Kiddle
       [not found]   ` <20030422180942.GA422@os.polanet.pl>
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2003-04-22 12:30 UTC (permalink / raw)
  To: GoTaR; +Cc: zsh-users

GoTaR wrote:
> 
> I don't remember if I asked it allready, but there is new version
> coming, so maybe once more: how to expand sth like this:
> 
> ~: rpm -qi *devel*[tab]

> ? I'd like to bring all matches to command line:

Sounds like you want to use the _all_matches completer, probably in
combination with _match. _all_matches should go at the beginning of the
list of completers, before _complete or _match.

> For files it works with ^x-* (or with some style/sth with tab).

If you want it to be bound to a key instead of part of the things tab
will do, create a new widget using _generic:
  zle -C all-matches complete-word _generic
  bindkey '^Xx' all-matches
  
Then put `all-matches' in the widget part of the context for any styles
you want to set. As a minimum, you'll need to set the completer style:
  zstyle ':completion:all-matches::::' completer _all_matches _complete _match

Oliver


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Expand from completion
       [not found]   ` <20030422180942.GA422@os.polanet.pl>
@ 2003-04-23  9:43     ` Oliver Kiddle
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Kiddle @ 2003-04-23  9:43 UTC (permalink / raw)
  To: GoTaR; +Cc: zsh-users

You wrote:
> > Then put `all-matches' in the widget part of the context for any styles
> > you want to set. As a minimum, you'll need to set the completer style:
> >   zstyle ':completion:all-matches::::' completer _all_matches _complete _match
> 
> Yeah, that's almost it, thanks! But two more questions:
> 
> ~: rpm -q *devel*[^Xx]
> ~: rpm -q ORBit-devel-0.5.17-2                                                 Tue 22 20:04:59 tty2
> RPM package                   _
> ORBit-devel-0.5.17-2                  esound-devel-0.2.29-1      libstdc++-devel-3.2.2-0.5
> SDL-devel-1.2.5-4                     expat-devel-1.95.6-2       libtiff-devel-3.6.0-0.beta.1
> [...]
> all matches
> ORBit-devel-0.5.17-2 SDL-devel-1.2.5-4 SDL_image-devel-1.2.3-1 SDL_mix
> 
> cursor goes in place of '_', so that moving around completions messes
> screen. How to avoid this?

I can't reproduce that problem so I'm not sure.

>  And second - how to make 'all matches' go
> directly into command line, without showing 'RPM package' with list?

When I wanted to do that myself, I added the insert style to
_all_matches but that change is only in zsh 4.1. So in 4.1, you can do:
  zstyle ':completion:all-matches:*' insert true

If you want to stick with 4.0, you could probably just take the
_all_matches patch from 16923 and put the modified _all_matches
somewhere early in your $fpath.

I also find it useful to set:
  zstyle ':completion:all-matches:*' old-matches true
so that if an existing list is displayed, perhaps from a different
completer, I can press ^Xx and it will insert all the matches from the
existing list.

Oliver


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-23  9:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22 10:52 Expand from completion GoTaR
2003-04-22 12:30 ` Oliver Kiddle
     [not found]   ` <20030422180942.GA422@os.polanet.pl>
2003-04-23  9:43     ` Oliver Kiddle

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).