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

Re: Playing with list-expand + complete-word

On Mon, Jul 21, 2014 at 10:40:40AM -0300, Silas Silva wrote:
> On Sun, Jul 20, 2014 at 10:02:38AM -0700, Bart Schaefer wrote:
> > See what you think of
> > 
> > bindkey $'\t' complete-word
> > zstyle ':completion:*' completer _complete _match _expand
> > zstyle ':completion:*:match:*' insert-unambiguous pattern
> The only difference is that, if I press tab twice, then glob is replaced
> by the first entry, and so on as I press tab again (which is better than
> I got) :-)
> Is there any advantage on using complete-word and configuring it with
> styles than doing what I did? (creating a new widget that calls
> list-choices, complete-word and list-expand)?

Actually your way is much better, for instance, think in the following

    $ cd /foo/bar/*x*<Tab>

My widget would just print all possible expansions, no matter if entries
are directories or files.  In your way, it sees the context is "cd" and
prints only directories.

I'm going to study styles further and check how can it be improved.

Thank you again! :-)

Silas Silva

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