Installation

Install with git

You can install the latest release of antidote by cloning it with git:

# first, run this from an interactive zsh terminal session:
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote

Install with a package manager

antidote may also be available in your system’s package manager:

.zshrc

After installation, the recommended way to use antidote is to call the antidote load command from your .zshrc:

# now, simply add these two lines in your ~/.zshrc

# source antidote
source /path/to/antidote/antidote.zsh

# initialize plugins statically with ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
antidote load

Note: If you installed antidote with a package manager, the path will be different than ${ZDOTDIR:-$HOME}/.antidote so you will need to modify the above script with source /path/to/antidote.zsh. For example, if you are using homebrew on macOS, the command you will need will be: source $(brew --prefix)/opt/antidote/share/antidote/antidote.zsh. Be sure to follow the instructions provided by your package manager.

Ultra high performance install

If you want to squeeze every last drop of performance out of your antidote config, you can do all the things antidote load does for you on your own. If you’re fairly comfortable with zsh, this is a more robust .zshrc snippet you can use:

# ${ZDOTDIR:-$HOME}/.zshrc

# Set the root name of the plugins files (.txt and .zsh) antidote will use.
zsh_plugins=${ZDOTDIR:-$HOME}/.zsh_plugins

# Ensure the .zsh_plugins.txt file exists so you can add plugins.
[[ -f ${zsh_plugins}.txt ]] || touch ${zsh_plugins}.txt

# Lazy-load antidote from its functions directory.
fpath=(/path/to/antidote/functions $fpath)
autoload -Uz antidote

# Generate a new static file whenever .zsh_plugins.txt is updated.
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
  antidote bundle <${zsh_plugins}.txt >|${zsh_plugins}.zsh
fi

# Source your static plugins file.
source ${zsh_plugins}.zsh

This is the minimal version. It only runs antidote bundle when needed. However, the speedup over antidote load is tiny and usually not worth it for most configs.

Uninstall

If you want to clean up antidote-managed artifacts, run the commands below from an interactive zsh session as needed.

# to remove snapshots:
rm -rf -- $(antidote snapshot home)

# to remove the bundle file and the generated static file:
rm -- ${ZDOTDIR:-$HOME}/.zsh_plugins.{txt,zsh}(N)

# to remove cloned bundles:
rm -rf -- $(antidote home)

How you remove antidote itself depends on how it was installed. Either use your system package manager’s uninstall/remove command, or remove its install directory if installed manually:

# manual install removal:
rm -rf /path/to/antidote