antidote: Can't seem to make completion work (taking oh-my-zsh docker plugins for example)

Hi, I’m not sure what I’m missing, but auto completion doesn’t seem to work for me.

This is my config:

https://github.com/zsh-users/zsh-completions
https://github.com/belak/zsh-utils path:completion

https://github.com/ohmyzsh/ohmyzsh path:lib
https://github.com/ohmyzsh/ohmyzsh path:plugins/docker kind:defer
https://github.com/ohmyzsh/ohmyzsh path:plugins/docker kind:fpath
https://github.com/ohmyzsh/ohmyzsh path:plugins/terraform kind:defer
https://github.com/ohmyzsh/ohmyzsh path:plugins/terraform kind:fpath

https://github.com/jeffreytse/zsh-vi-mode

And I’m trying to make docker and terraform completions work.

If I run compinit manually in a shell, they work in that shell. From the docs, it seems that adding those completion plugins at the top should work, but I don’t know what I’m missing.

I tried having them as kind:defer only (only 1 line instead of the 2 lines I have), but that doesn’t work either


It might have something to do with zsh-vi-mode’s “after init” commands, and I am using a zvm_after_init() function to run “extra commands”, so I might need to do something similar for those plugins as well (however, I tried disabling zsh-vi-mode, but I still don’t have the completion)

Can you please let me know if this issue can be solved? I really want to switch to antidote, but these are preventing me from doing that 🙁

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 17 (7 by maintainers)

Most upvoted comments

As of June 2024, the recommended way of handling OMZ is now to include the new getantidote/use-omz plugin at the TOP of your .zsh_plugins.txt file. It handles all OMZ dependency resolution, setting OMZ variables, and deferred completion initialization for OMZ users. No more compdef errors, and no more need to use a separate completion plugin!

Hi Team, I am also unable to get auto complete to work with ohmyzsh plugins like asdf, docker etc. Kindly suggest.

Does this mean that there’s a better way for me to load antidote if this happens?

No. The recommended way to load antidote is absolutely to use antidote load, however there is a different way to load it if you really want to avoid any calls to antidote whatsoever unless absolutely necessary. Depending on which way you choose, you’ll see different output in zprof. My call out was merely that somethings you see in zprof are rollups of the underlying work, so antidote-load will look like it takes the longest, but really it’s the summation of all your plugin timings, and if you load it a different way your config will still take just as long, you just won’t see all that grouped together under one heading.

I might have this (not sure TBH).

You are only using instant prompt if .zsh_plugins.txt contains romkatv/powelevel10k and the first few lines in your .zshrc is this:

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

Based on the behavior you describe, I don’t think you are. I suspect you have $ZSH_THEME set to an Oh-My-Zsh theme. Switching to powerlevel10k might be the quickest possible way for you to see a big speed improvement without a lot of additional detective work. Its claim to fame is its the fastest Zsh prompt available.

Feel free to post your zprof results here though, and I can try to help more. Without seeing what you’re seeing though, this is the best I can offer.

@farzadmf in the OMZ Docker readme, they include this snippet that allows for -it rather than -i -t

zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes

But this doesn’t give you the completion for the flags, it just lets you still have completion for container names after passing -it

Still not working 🙁

At this point, we aren’t really discussing a bug in antidote, but rather OMZ’s dependency rat’s nest.

Totally agree. TBH, I don’t care about OMZ (or any other framework for that matter 😛); I just want my completion to be there 😆

Or, you might also consider whether you need OMZ’s whole lib directory.

It has some nice aliases for path navigation that I use regularly, but even if I disable it (comment it out), nothing changes, and I don’t have auto complete


A couple of questions for you:

  • From the antidote manual, I see two plugins are mentioned for completion:
https://github.com/zsh-users/zsh-completions
https://github.com/belak/zsh-utils path:completion

Is only one of these enough? Or should I have both?

  • Do I need to do anything for antidote to pick up my changes to the plugin file? Or is it automatic and a new shell is enough to test the changes? This is what I’m doing in my ~/.zshrc:
source "$HOMEBREW_PREFIX/opt/antidote/share/antidote/antidote.zsh"
antidote load "${ZDOTDIR:-$HOME}/.zsh_plugins.txt"