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

Re: completion within a function



On Wed, Dec 30, 2020 at 9:44 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Dec 30, 2020 at 9:22 AM Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
> >
> > After removing all the unnecessary stuff from the tests, I came up
> > with this script that does list completions:
>
> I think it might be possible to do something even less complicated.

It's also possible to capture completions without IPC (via zpty or
otherwise). It's faster and gives more context but it's difficult and
verbose. I do this in my own setup in order to replace the built-in
completion menu with an alternative one (fzf that opens above the
cursor). You can see it in this demo: https://asciinema.org/a/372068.
The bulk of the code is in
https://github.com/romkatv/zsh4humans/blob/v5/fn/z4h-fzf-complete.

Roman.




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