zsh-users
 help / color / mirror / code / Atom feed
* How to insert completions on command line
@ 2006-08-18 23:47 Mikael Magnusson
  2006-08-19  3:53 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Magnusson @ 2006-08-18 23:47 UTC (permalink / raw)
  To: zsh-users

Hello,
(How do I|Is there a way to) insert all completions in the command
line? In case that sounds like i'm confused, which i am, this is what
i mean:
% cvs remove <tab>
file1.c
anotherfile.c
hello.c

and i want to get cvs remove file1.c anotherfile.c hello.c without
pressing tab and space about 8 times. I've tried all commands/keybinds
i can come up with but no luck so far.

-- 
Mikael Magnusson


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

* Re: How to insert completions on command line
  2006-08-18 23:47 How to insert completions on command line Mikael Magnusson
@ 2006-08-19  3:53 ` Bart Schaefer
  2006-08-19  5:15   ` Mikael Magnusson
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2006-08-19  3:53 UTC (permalink / raw)
  To: zsh-users

On Aug 18,  4:47pm, Mikael Magnusson wrote:
}
} (How do I|Is there a way to) insert all completions in the command
} line?

zstyle :completion:expand-word:expand:\* tag-order all-expansions

Then type ctrl-X e


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

* Re: How to insert completions on command line
  2006-08-19  3:53 ` Bart Schaefer
@ 2006-08-19  5:15   ` Mikael Magnusson
  2006-08-19 18:17     ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael Magnusson @ 2006-08-19  5:15 UTC (permalink / raw)
  To: zsh-users

On 8/19/06, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Aug 18,  4:47pm, Mikael Magnusson wrote:
> }
> } (How do I|Is there a way to) insert all completions in the command
> } line?
>
> zstyle :completion:expand-word:expand:\* tag-order all-expansions
>
> Then type ctrl-X e

This seems to only have an effect on globbing completions, like touch
*<ctrl-x e> <- this works, but not cvs remove <ctrl-x e> <- nothing
happens, with or without the zstyle applied.

-- 
Mikael Magnusson


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

* Re: How to insert completions on command line
  2006-08-19  5:15   ` Mikael Magnusson
@ 2006-08-19 18:17     ` Bart Schaefer
  2006-08-19 19:38       ` Mikael Magnusson
  2006-08-19 23:41       ` Vincent Lefevre
  0 siblings, 2 replies; 8+ messages in thread
From: Bart Schaefer @ 2006-08-19 18:17 UTC (permalink / raw)
  To: zsh-users

On Aug 18, 10:16pm, Mikael Magnusson wrote:
}
} > zstyle :completion:expand-word:expand:\* tag-order all-expansions
} >
} > Then type ctrl-X e
} 
} This seems to only have an effect on globbing completions

That's the second time this summer I've misinterpreted that same
question.  (Which means the answer is in the zsh-users archives
from only a few weeks ago, if you had looked.)

Look up _all_matches in the manual.

          zle -C all-matches complete-word _generic
          bindkey '^Xa' all-matches
          zstyle ':completion:all-matches:*' old-matches only
          zstyle ':completion:all-matches::::' completer _all_matches


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

* Re: How to insert completions on command line
  2006-08-19 18:17     ` Bart Schaefer
@ 2006-08-19 19:38       ` Mikael Magnusson
  2006-08-19 23:41       ` Vincent Lefevre
  1 sibling, 0 replies; 8+ messages in thread
From: Mikael Magnusson @ 2006-08-19 19:38 UTC (permalink / raw)
  To: zsh-users

On 8/19/06, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Aug 18, 10:16pm, Mikael Magnusson wrote:
> }
> } > zstyle :completion:expand-word:expand:\* tag-order all-expansions
> } >
> } > Then type ctrl-X e
> }
> } This seems to only have an effect on globbing completions
>
> That's the second time this summer I've misinterpreted that same
> question.  (Which means the answer is in the zsh-users archives
> from only a few weeks ago, if you had looked.)
>
> Look up _all_matches in the manual.
>
>           zle -C all-matches complete-word _generic
>           bindkey '^Xa' all-matches
>           zstyle ':completion:all-matches:*' old-matches only
>           zstyle ':completion:all-matches::::' completer _all_matches

Thanks, that works perfectly. Looking at the old message i vaguely
remember reading it at the time, but didn't realize i would want it.
I'm also not sure what i would have searched for without knowing the
name "_all_matches".

-- 
Mikael Magnusson


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

* Re: How to insert completions on command line
  2006-08-19 18:17     ` Bart Schaefer
  2006-08-19 19:38       ` Mikael Magnusson
@ 2006-08-19 23:41       ` Vincent Lefevre
  2006-08-20  3:16         ` Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2006-08-19 23:41 UTC (permalink / raw)
  To: zsh-users

On 2006-08-19 11:17:54 -0700, Bart Schaefer wrote:
>           zle -C all-matches complete-word _generic
>           bindkey '^Xa' all-matches
>           zstyle ':completion:all-matches:*' old-matches only
>           zstyle ':completion:all-matches::::' completer _all_matches

I've tried for instance: mail ^Xa
but the ^Xa has no effect, whereas [Tab] lists all the possible
completions.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: How to insert completions on command line
  2006-08-19 23:41       ` Vincent Lefevre
@ 2006-08-20  3:16         ` Bart Schaefer
  2006-08-20 22:09           ` Vincent Lefevre
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2006-08-20  3:16 UTC (permalink / raw)
  To: zsh-users

On Aug 20,  1:41am, Vincent Lefevre wrote:
} Subject: Re: How to insert completions on command line
}
} On 2006-08-19 11:17:54 -0700, Bart Schaefer wrote:
} >           zle -C all-matches complete-word _generic
} >           bindkey '^Xa' all-matches
} >           zstyle ':completion:all-matches:*' old-matches only
} >           zstyle ':completion:all-matches::::' completer _all_matches
} 
} I've tried for instance: mail ^Xa
} but the ^Xa has no effect, whereas [Tab] lists all the possible
} completions.

I had forgotten (and the manual, from which I copied those lines, doesn't
state directly) how _all_matches works.  You have to first generate the
list of completions with a normal completer (such as by pressing tab) and
then type ^Xa to insert them on the line.  _all_matches doesn't generate
any completions of its own.

To get the effect of having ^Xa both generate and insert completions,
you need:

	zle -C all-matches complete-word _generic
	bindkey '^Xa' all-matches
	zstyle ':completion:all-matches:*' insert yes
	zstyle ':completion:all-matches::::' completer \
		_all_matches _complete

Replace or augment _complete with whatever other completers you want,
but _all_matches must come first.


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

* Re: How to insert completions on command line
  2006-08-20  3:16         ` Bart Schaefer
@ 2006-08-20 22:09           ` Vincent Lefevre
  0 siblings, 0 replies; 8+ messages in thread
From: Vincent Lefevre @ 2006-08-20 22:09 UTC (permalink / raw)
  To: zsh-users

On 2006-08-19 20:16:27 -0700, Bart Schaefer wrote:
> I had forgotten (and the manual, from which I copied those lines, doesn't
> state directly) how _all_matches works.  You have to first generate the
> list of completions with a normal completer (such as by pressing tab) and
> then type ^Xa to insert them on the line.  _all_matches doesn't generate
> any completions of its own.

Thanks. IMHO, the manual should be more detailed.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

end of thread, other threads:[~2006-08-20 22:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-18 23:47 How to insert completions on command line Mikael Magnusson
2006-08-19  3:53 ` Bart Schaefer
2006-08-19  5:15   ` Mikael Magnusson
2006-08-19 18:17     ` Bart Schaefer
2006-08-19 19:38       ` Mikael Magnusson
2006-08-19 23:41       ` Vincent Lefevre
2006-08-20  3:16         ` Bart Schaefer
2006-08-20 22:09           ` Vincent Lefevre

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