antidote(1) | Antidote Manual | antidote(1) |
antidote - the cure to slow zsh plugin management
antidote [-v | –version] [-h | –help] <command> [<args> ...]
antidote is a Zsh plugin manager made from the ground up thinking about performance.
It is fast because it can do things concurrently, and generates an ultra-fast static plugin file that you can easily load from your Zsh config.
It is written natively in Zsh, is well tested, and picks up where Antigen and Antibody left off.
Create a .zsh_plugins.txt file with a list of the plugins you want:
# ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search
zsh-users/zsh-autosuggestions
Now, simply load your newly created static plugins file in your .zshrc.
# ${ZDOTDIR:-$HOME}/.zshrc
source /path/to/antidote/antidote.zsh
antidote load
Your .zsh_plugins.txt file supports annotations. Annotations tell antidote how to do things like load plugins from alternate paths. This lets you use plugins from popular frameworks like Oh-My-Zsh:
# ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/magic-enter
etc...
Users familiar with legacy plugin managers like Antigen might prefer to use dynamic bundling. With dynamic bundling you sacrifice some performance to avoid having separate plugin files. To use dynamic bundling, we need to change how antidote bundle handles your plugins. We do this by sourcing the output from antidote init.
An example config might look like this:
source /path/to/antidote/antidote.zsh
source <(antidote init)
antidote bundle zsh-users/zsh-autosuggestions
antidote bundle ohmyzsh/ohmyzsh path:lib
antidote bundle ohmyzsh/ohmyzsh path:plugins/git
Instead of calling antidote bundle over and over, you might prefer to load bundles with a HEREDOC.
source /path/to/antidote/antidote.zsh
source <(antidote init)
antidote bundle <<EOBUNDLES
zsh-users/zsh-syntax-highlighting # regular plugins
ohmyzsh/ohmyzsh path:lib # directories
ohmyzsh/ohmyzsh path:plugins/magic-enter # frameworks
https://github.com/zsh-users/zsh-history-substring-search # URLs
EOBUNDLES
To install antidote you can clone it with git:
git clone –depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote
Then, simply add the following snippet to your .zshrc:
source ${ZDOTDIR:-$HOME}/.antidote/antidote.zsh
antidote load
The location where antidote clones repositories can bu customized by setting $ANTIDOTE_HOME:
ANTIDOTE_HOME=/path/to/my/repos
The bundle directory in ANTIDOTE_HOME can be changed to use friendly names with the following zstyle:
zstyle ':antidote:bundle' use-friendly-names on
The default bundle file is ${ZDOTDIR:-$HOME}/.zsh_plugins.txt. This can be overridden with the following zstyle:
zstyle ':antidote:bundle' file /path/to/my/bundle_file.txt
The default static file is ${ZDOTDIR:-$HOME}/.zsh_plugins.zsh. This can be overridden with the following zstyle:
zstyle ':antidote:static' file /path/to/my/static_file.zsh
The default options used by romkatv/zsh-defer can be changed with the following zstyle:
zstyle ’:antidote:bundle:*’ defer-options `-a'
zstyle `:antidote:bundle:foo/bar' defer-options `-p'
Bundles can be Zsh compiled with the following zstyle:
zstyle ’:antidote:bundle:*’ zcompile `yes'
Or, if you only want to zcompile specific bundles, you can set those individually:
zstyle ’:antidote:bundle:*’ zcompile `yes'
zstyle `:antidote:bundle:zsh-users/zsh-syntax-highlighting' zcompile `no'
The static file can be Zsh compiled with the following zstyle:
zstyle `:antidote:static' zcompile `yes'
For more information, visit https://getantidote.github.io/
See GitHub Issues: <https://github.com/mattmc3/antidote/issues>
MIT