Linuxbrew/brew

Help on loading zsh completions with antibody

aserrallerios opened this issue · 5 comments

Migrating from the old oh-my-zsh plugin I'm trying to load the completions available in this repository with no luck. I'm using antibody:

Linuxbrew/brew path:completions/zsh/_brew
Linuxbrew/brew path:completions/zsh/_brew_cask

I get this errors:

_arguments:comparguments:325: can only be called from completion function
_arguments:comparguments:325: can only be called from completion function

It's not immediately obvious how should I load the completions. I guess I won't be the only one on that situation, so probably some lines on the documentation would be enough.

I'm afraid that I have no familiarity with antibody. You'll need to ask their developers.

Well, Antibody just loads the files assuming they're zsh plugins. Are you interested in defining a zsh.plugin file in this repo that could be loaded from antigen/antibody?

Linuxbrew/brew path:completions/zsh/

If so, I just need some help to open a PR: how do you load those completions manually?

What about the files in ls $(brew --prefix)/share/zsh/site-functions ? Is this what you are looking for?

I have no clue about zsh plugins or antibody. We would accept a change if it is added to the mac repo first (if it is a Linux-only solution, then we may consider it for inclusion). But you need to give more details because we are not going to read through the whole zsh/antibody documentation.

So I've figured out why it was failing. Antibody just sources the plugin.zsh file and then adds to fpath the files of the folder. If no plugin.zsh file is found, it does nothing.

It works if I add an empty file /completions/zsh/something.plugin.zsh but I'm asking for other options in the antibody repo, as that's a bit of a workaround.

Thanks!

Glad to hear that you got it working, Albert!