Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.66k stars 237 forks source link

Help on loading zsh completions with antibody #905

Closed aserrallerios closed 5 years ago

aserrallerios commented 5 years ago

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.

sjackman commented 5 years ago

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

aserrallerios commented 5 years ago

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?

iMichka commented 5 years ago

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.

aserrallerios commented 5 years ago

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!

sjackman commented 5 years ago

Glad to hear that you got it working, Albert!