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

Re: completer that first expands global aliases (Re: dsf)

On Tue, 08 Jan 2013 09:41:55 +0000 (UTC)
Daniel <quite@xxxxxxxx> wrote:
> On 2013-01-07, Daniel <quite@xxxxxxxx> wrote:
> > I have a nice little recent-files completer, see below.
> > (found here:
> > http://michael.stapelberg.de/Artikel/zsh_recent_completion )
> >
> > What I would like to add to this, is for it to expand global
> > aliases inline, before trying to complete (and thus ending up
> > completing files in my aliased directory).
> >
> > I started trying to meld _generic and _expand_alias, but with my
> > lack of fluency in zsh, I just made a mess :) Any help out there?
> > Is there perhaps some generic way for having this done for all
> > completion? A zstyle for _main_complete?

I can't see a straightforward way of doing this; it looks like it needs
some complicated rewriting of _expand_alias into some other function, as
you were trying.

It might be possible to rig up something at a higher level (probably ZLE
widgets rather than completion) to call _expand_alias, ensuring it
accepts the result with all expansions, then call the generic completion
you want, but I haven't thought that through.


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