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

Re: Playing with list-expand + complete-word



Hi there Bart and guys!  Thank you for the answer.  Here we go!

> Whether or not you've run compinit,
> 
>     bindkey $'\t' complete-word
>     setopt glob_complete
> 
> will probably get you very close to the behavior you want.  How it works
> out in combination with the zstyle settings you've experimented with, I
> can't say.
> 
> Equivalently (if you *have* run compinit), you should be able to add
> _match to your list of completers, e.g.
> 
>     zstyle ':completion:*' completer _complete _match
> 
> If glob_complete doesn't seem to be what you want ...

Both setopt glob_complete and using zstyle mechanism have the same
effect.  It is near of what I need, but it still expand the glob to the
first entry of the matching list, instead of listing the glob expansions
(what list-expand would do) and let the original glob intact.

> What you probably want there is
> 
>     zle list-choices || zle list-expand || zle complete-word

It works really great, with the exception that it never completes
(probably complete-word) is never called.  I took your suggestion and
switched them to:

    zle complete-word || zle list-choices || zle list-expand

Which really seems what I want (still testing).  Thank you! :-)

> You've just described the behavior of the _expand completer when the
> "suffix" zstyle is true (the default).  What's the current value of
> your "completer" zstyle?

I also tried setting tab to complete-word and changing zstyle to:

    zstyle ':completion:*' completer _expand _complete

It listed options but still cycled through them (replacing glob, which I
doesn't want).  So I did:

    zstyle ':completion::expand:*' tag-order original -

It didn't replace the glob, but obviously disabled listing.

Creating the new widget that calls different completers seem to be the
best solution for this, but I'm still testing it.

Thank you very much!

-- 
Silas Silva



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