Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

how to customize _all_matches use?



 Hello,

 I'd like to have a key binding which would complete all matches which I
would get by pressing TAB at once. AFAICS from the manual/user guide, this
is what the all-matches completer is for and so, following the examples
there, I tried to do the following:

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

However this doesn't seem to work:

	% ls
	bar  baz  foo
	% ls ^Xa # nothing happens

I do get the behaviour I want if I do

	% zstyle ':completion:all-matches:*' completer _all_matches _complete

but with one extremely annoying side-effect:

	% ls ^Xa
	% ls bar baz foo # this is the same line completed by the shell
	bar baz foo
	bar  baz  foo

i.e. although I do get all the completions I also get *2* lists of them
below. I would understand it if I was getting 1 line because I use
MENU_COMPLETE (and no other non-default completion options), but where does
the second one come from? Also, I'd like to not see anything at all if
possible. So what am I doing wrong?


 And, of course, I don't really want to have this behaviour so much for ls
as for other commands where the completion can't be replaced with just '*'.
For example, it would be very useful to have for "cvs diff" for which I use

	zstyle ':completion::complete:cvs-diff:argument-rest:' \
		tag-order existing-files removed-files directories

so that pressing TAB after "cvs di" normally completes only the modified
files. But pressing ^Xa also completes the sub-directories -- is there any
way I could avoid this?

 Thanks in advance for any help!
VZ

P.S. If it matters, I'm using 4.3.2 under Debian Linux



Messages sorted by: Reverse Date, Date, Thread, Author