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

RE: Getting context sensitive glob expansions using new completion

> Borsenkow Andrej wrote:

> Alternatively one can make _all_matches insert a pseudo-match for all
> results from _match, if any:

>   zstyle ':completion:*' completer _complete _all_matches _match
>   zstyle ':completion:*:match:*' group-order all-matches

Thanks, that nearly does what I want. However, I think that tag-order
should do exactly what I want. As in the line I tried previously:

  zstyle ':completion:*:match:*' tag-order all-matches

However, this seems to have no effect. Why is that?

> But the question is: do you really want that?  The consens on this
> list seems to be now that _all_matches is most useful as a separate
> widget.  I.e. you set up completion as you like, without thinking
> about the possibility to insert all matches.  Then you add a new
> binding as described in the manual for _all_matches:
>   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
> And voila, now you can use normal completion until you have the set
> matches you want to insert in the line and then hit ^Xa to do that.

Well I guess its just what I'm used to. Currently I tab to expand the line
and if I don't like it I just undo (ctrl-/), which has always been how Zsh
used to do it. Having said that I like the sound of what you suggest here
so I'll try that out. Some habits are worth changing. ;)

As an aside, the completion system is extremely powerful and not a little
bit difficult to understand and configure when completely new to it.
There's also lots of these little nuggets of information which can help
configure it how you like. Some of them are in various places in the
manual, some on this list, and most are probably still 'secret'. What I
think would be really useful is a hints & tips section in the manual. Kind
of 'if you want this - do this'.



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