Antidote is a feature-complete Zsh implementation of the legacy Antibody plugin manager, which in turn was derived from Antigen Antigen.
This gave me high hopes that a migration could be done with minimal effort. And indeed, it was a piece of cake. Here’s how I did it.
Before I start with the migration steps, I need to tell you how I configured and used Antigen, as the plugin manager was quite open to different setups. Depending on this, the migration may require more or less work than in my case. However, it should still be pretty straightforward - I mean, we are talking about a plugin manager that pulls Git repos here.
I installed Antigen via Homebrew and added the following configuration to my .zshrc
:
.zshrczsh
# Enable Antigensource $HOMEBREW_PREFIX/share/antigen/antigen.zsh# Load Antigen configuration# ´antigen init´ command doesn't look into bundle configuration changes,# thus ´antigen reset´ is needed to reload pluginsantigen init ~/.antigenrc
As you can see, I used the init command to speed up load times by improving the cache performance. It had some drawbacks, like having to call antigen reset
after changing the bundle configuration, but since I didn’t change my plugin setup that often, it was fine for me. To use this command, a separate configuration file had to be created to hold the actual plugin configuration:
.antigenrczsh
# ´antigen init´ command doesn't look into bundle configuration changes,# thus ´antigen reset´ is needed to reload pluginsantigen use oh-my-zshantigen bundles <<EOBUNDLESfzfautojumpdirhistorybgnotifygitsudosdkgradlenpmyarndockerdocker-composedocker-machinegcloudzsh-users/zsh-completionszsh-users/zsh-autosuggestionszsh-users/zsh-syntax-highlightinggrigorii-zander/zsh-npm-scripts-autocomplete@mainredxtech/zsh-yupntnyq/omz-plugin-pnpm --branch=mainEOBUNDLESantigen theme romkatv/powerlevel10kantigen apply
If your configuration is similar, you can follow the steps below to migrate to Antidote.
First, remove Antigen from your system. If you installed it via Homebrew, you can do this with the following command:
zsh
brew rm antigen
Then you can install Antidote :
zsh
brew install antidote
Remove the sourcing of Antigen and the antigen init
command from your .zshrc
. Instead, we now need to source Antidote and initialise the Antidote plugins.
.zshrczsh
# Enable Antidotesource $HOMEBREW_PREFIX/opt/antidote/share/antidote/antidote.zsh# Initialize Antidote plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txtantidote load
The plugin configuration is now stored in a file called .zsh_plugins.txt
. This file should be created either in your home directory or in the directory specified by the ZDOTDIR
environment variable, if it’s set. A few things work differently here than in Antigen:
#
.zsh_plugins.zsh
file, which is then sourced in the .zshrc
.zsh_plugins.txttxt
romkatv/powerlevel10kzsh-users/zsh-completionsbelak/zsh-utils path:completionohmyzsh/ohmyzsh path:libohmyzsh/ohmyzsh path:plugins/fzfohmyzsh/ohmyzsh path:plugins/autojumpohmyzsh/ohmyzsh path:plugins/dirhistoryohmyzsh/ohmyzsh path:plugins/bgnotifyohmyzsh/ohmyzsh path:plugins/gitohmyzsh/ohmyzsh path:plugins/sudoohmyzsh/ohmyzsh path:plugins/sdkohmyzsh/ohmyzsh path:plugins/gradleohmyzsh/ohmyzsh path:plugins/npmohmyzsh/ohmyzsh path:plugins/yarnohmyzsh/ohmyzsh path:plugins/gcloudgrigorii-zander/zsh-npm-scripts-autocompleteredxtech/zsh-yupntnyq/omz-plugin-pnpmzsh-users/zsh-syntax-highlightingzsh-users/zsh-autosuggestions
Antidote doesn’t support Antigen’s commands, but you can use annotations to achieve the same result. Annotations are added at the end of a plugin line, separated by a space. The annotation path
allows you to specify the subdirectory where the plugin is located, which is particularly useful for frameworks, and is used here for belak/zsh-utils
and ohmyzsh/ohmyzsh
. There are also other annotations which can be found in the Antidote documentation .
There are a lot of helpful comments in the sample Zsh config , which I recommend you take a look at. They can help you with the migration and also give you an idea of what else you can do with Antidote and ZSH plugins in general.