-
Notifications
You must be signed in to change notification settings - Fork 279
Commands
This command tells Antigen to install (if not already installed) and load the given plugin. The simplest usage follows the following syntax.
antigen bundle <plugin-name>
This will install and load the plugins/<name>
directory from [robbyrussell's
oh-my-zsh][oh-my-zsh] (can be changed by setting ANTIGEN_DEFAULT_REPO_URL
).
However, the above is just syntax sugar for the extended syntax of the
antigen bundle
command.
antigen bundle [<url>[@tag|branch] [<loc>]]
where <url>
is the repository url and it defaults to [robbyrussell's
oh-my-zsh][oh-my-zsh] repo (can be changed by setting ANTIGEN_DEFAULT_REPO_URL
discussed further down). <loc>
is the path under this repository which has the
zsh plugin. This is typically the directory that contains a *.plugin.zsh
file,
but it could contain a completion file or just many *.zsh
files to be sourced,
or it could simply be a file (with any extension) that you want to source.
<loc>
defaults to /
, which indicates the repository itself is a plugin.
Use @tag
or @branch
to request a tag or a branch. You may use semver-like format
such as 0.5.*
.
An example invocation would be
# The following is the same as `antigen bundle ant`. But for demonstration
# purposes, we use the extended syntax here.
antigen bundle https://github.com/robbyrussell/oh-my-zsh.git plugins/ant
This would install the ant plugin from robbyrussell's oh-my-zsh repo. Of course, github url's can be shortened.
antigen bundle robbyrussell/oh-my-zsh plugins/ant
And since this repo is the default, even that isn't necessary. But we can't
specify the loc
without giving the first argument.
For this and a few other reasons, antigen bundle
also supports a simple
keyword argument syntax, using which we can rewrite the above as
antigen bundle --loc=plugins/ant
Which picks up the default for the url
argument, and uses the loc
given to
it.
Note that you can mix and match positional and keyword arguments. But you can't have positional arguments after keyword arguments.
antigen bundle robbyrussell/oh-my-zsh --loc=plugins/ant
And keyword arguments don't care about the order in which the arguments are specified. The following is perfectly valid.
antigen bundle --loc=plugins/ant --url=robbyrussell/oh-my-zsh
You can also specify a local directory on your file system as a bundle. In this
case, make sure the path you give is the absolute path (i.e., starts with a
/
). Relative paths are not supported. If the repo you gave is a local
directory path, then it is not necessary that this path is a git repo. Please
refer to the notes on --no-local-clone
below.
This command can also be used from your shell environment. This allows you to
install plugins on the fly and try them out. Of course if you want a bundle to
be available every time you open a shell, put it in your .zshrc
.
Other keyword-only arguments accepted:
--branch={git-branch-name|tag}
— Specify the branch of the git repo to be
used for this bundle (without the braces of course). The default is whatever
branch the clone comes with, which is usually master
. For example,
antigen bundle github-user/repo --branch=develop
This will get the plugin as in the branch develop
.
Note that if you specify two plugins to be loaded from the same git repo, but different branches, then two separate clones of this repo will be maintained. This is a small implementation detail and shouldn't influence you in any way.
--no-local-clone
— This command can be useful if you are developing a
plugin and already have a clone on your local file system. If this argument is
not given, even if the given repo url is a local path, a clone is made in the
$ANTIGEN_BUNDLES
directory, and the plugin is loaded from that clone. But, if
you give this argument, the plugin is sourced straight from the repo location,
without creating a clone. For example,
antigen bundle /absolute/path/to/the/plugin --no-local-clone
Note that if the repo url is not an absolute local path or a branch has been
specified with the --branch
option, this argument has no effect. That is,
for this option to have any affect, the repo url must be an absolute local path
and no --branch
should be specified.
Also, if the local path given as the url is not a git repo, then this argument is forced as it doesn't makes sense to clone something that's not a git repo. This property can be used to load any utility scripts you have in your dotfiles repo. For example,
antigen bundle $HOME/dotfiles/oh-my-zsh/custom
For details on what constitutes a valid bundle and how Antigen handles different types of bundles, see the Notes on writing plugins section.
If you have a fair number of bundles, using the antigen bundle
command can
look cumbersome. You can use the antigen bundles
command to bulk define
bundles instead of individual calls to antigen bundle
.
Usage is pretty straightforward. Just pipe the bundle specifications, just as
you would give to the antigen bundle
command, one per line, into the
antigen bundles
command. The easiest way to do this, is using the heredoc
syntax.
antigen bundles <<EOBUNDLES
# Guess what to install when running an unknown command.
command-not-found
# The heroku tool helper plugin.
heroku
EOBUNDLES
This is equivalent to
antigen bundle command-not-found
antigen bundle heroku
Of course, as you can see, from the lines piped to antigen bundles
, empty
lines and those starting with a #
are ignored. The rest are passed to
antigen bundle
without any quoting rules applied. They are actually eval
-ed
with the antigen bundle
command. See the source if you want to really
understand how it works. Its a very small function.
Note: Indenting the contents inside the EOBUNDLES heredoc is not required for antigen-bundles to work. Its allowed (and encouraged) to improve readability.
Another thing to take into account is that variables (ex. environment variables)
and especial builtin characters (~
, .
) won't work inside a heredoc, so you may
have to change a antigen-bundle
syntax to work with antigen-bundles
.
Use this command to generate Antigen's cache with currently loaded bundles.
antigen cache-gen
Takes no arguments.
Makes use of caching in order to quickly load bundles. Improves performance greatly and it's recommened if you have an stable set of bundles.
antigen init /path/to/.antigenrc
Where .antigenrc
contains your Antigen configuration (antigen bundle
,
antigen bundles
, antigen theme
, etc). See wiki's cookbook section
for further details.
This is something you might not want to put in your .zshrc
. Instead, run it
occasionally to update your plugins.
antigen update [<bundle-name>]
Where <bundle-name>
is the bundle name to update. If no <bundle-name>
is given
Antigen will update all loaded bundles (see antigen-list
). Location, branch or
any other bundle argument are not needed as those're retrieved from the antigen-list
metadata.
Please note that the updates that are downloaded are not immediately available. You have to open a new shell to be able to see the changes. This is a limitation by design since reloading all the plugins might have some nasty side effects that may not be immediately apparent. Let's just say it can make your shell act real quirky.
Please note: This command is not for updating Antigen itself. Its for
updating the bundles you are using with Antigen. To update your copy of Antigen,
use the selfupdate
command described further below.
Reverts the state of all your plugins to how they were before the last
antigen update
.
Takes no options.
Insider detail: The information for reverting is stored in
$ADOTDIR/revert-info
file. If its not present, reverting is not possible.
Use this command to list out the currently loaded plugins. Keep in mind that this includes any bundles installed on-the-fly.
antigen list [--simple|--short|--long]
With --long
flag it gives out five entries per line of output,
denoting the following fields of each bundle.
<repo-url> <loc> <btype> <has-local-clone?> <branch>
The btype
field is an internal detail, that specifies if the bundle is a
plugin
or a theme
.
The <has-local-clone>
field is true
or false
reflecting whether there is
a local clone for this bundle.
With --short
flag the output is simplier:
<repo-name> @ <branch|tag|ref>
A barebones list can be obtained with --simple
flag, with the following output:
<repo-name>
With --short
argument it will only print short bundle names only.
Used to clean up the clones of repos which are not used by any plugins currently loaded. It takes no arguments. When run, it lists out the repo-clones that are available but are not used by any plugin currently loaded.
This command, by default asks for confirmation before deleting the unused
clones. If the --force
argument is given, then this confirmation is not asked.
It straight away deletes all the unused clones. This option makes this command
usable in a non-interactive fashion.
This command removes a bundle from filesystem. Usage:
antigen purge example/bundle [--force]
Where example/bundle
is the bundle you want to purge from filesystem.
Take into account that the bundle will be removed from filesystem but next time
you open up a shell, if you have an antigen bundle example/bundle
line laying
around, the bundle will be installed again.
This command, by default asks for confirmation before deleting bundles. If the
--force
argument is given, then this confirmation is not asked.
If cache is enabled this command will clean the generated cache. This is useful
if you are using antigen-init
command in order to reload bundle configuration changes.
Usage:
antigen reset
Takes no further arguments.
This command lets you load any (supported) zsh pre-packaged framework, like oh-my-zsh, as well as any library from custom url. Usage is
antigen use oh-my-zsh
Additional arguments may be present depending on the framework you are
use
-ing. Here are the supported frameworks.
It basically installs the oh-my-zsh's library as a bundle.
One other thing it does is that some oh-my-zsh plugins expect a $ZSH
set to
the full path of the oh-my-zsh clone being used. This is also set to the
correct path, if not already set to something else.
Please note that this assumes that the ANTIGEN_DEFAULT_REPO_URL
is set to the
oh-my-zsh repo or a fork of that repo. If you want to specify the url
too,
then you can't use the antigen use oh-my-zsh
short cut. You have to do that
directly with the antigen bundle
command.
Use
antigen use oh-my-zsh
in your .zshrc
, before any antigen bundle
declarations. It takes no further
arguments.
Use
antigen use prezto
in your .zshrc
, before any antigen bundle
declarations. It takes no further arguments.
This initializes the prezto framework. Your .zshrc
file could look like this:
antigen use prezto
antigen bundle sorin-ionescu/prezto modules/helper # required for Git module
antigen bundle sorin-ionescu/prezto modules/editor
antigen bundle sorin-ionescu/prezto modules/git
antigen bundle sorin-ionescu/prezto modules/prompt
antigen apply
Use
antigen use https://github.com/custom/lib.git
in your .zshrc
, before any antigen bundle
declarations. It take all arguments
antigen-bundle
command does.
Used for switching the prompt theme. Invoke it with the name of the theme you want to use.
antigen theme fox
This will get the theme file located at themes/fox.zsh-theme
in the repo
specified by ANTIGEN_DEFAULT_REPO_URL
.
To pull themes from other repositories, use antigen theme
just like
antigen bundle
. Exactly the same, just make sure the url
and loc
combination point to a theme file, having a .zsh-theme
extension.
For example,
antigen theme robbyrussell/oh-my-zsh themes/apple
Will pull the apple theme from the canonical oh-my-zsh repo. Also, note that the
.zsh-theme
extension is not present. It can be given, its optional.
To get themes from arbitrary git repos (such as gists) use,
antigen theme https://gist.github.com/3750104.git agnoster
in which case there is a file called agnoster.zsh-theme
present in the gist at
https://gist.github.com/3750104.
You can use this command to change your theme on the fly in your shell. Go on,
try out a few themes in your shell before you set it in your .zshrc
.
Note: Some themes use functions that are loaded by antigen use oh-my-zsh
.
So, to avoid any trouble, run antigen use oh-my-zsh
if you haven't already
before experimenting with themes. If you have antigen use oh-my-zsh
in your
.zshrc
, you're covered.
Note: Antigen caches bundles to provide fast start up times. This functionality may cause issues if you're dynamically loading bundles based on environment variables or other conditionals. For example:
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
antigen theme bhilburn/powerlevel9k powerlevel9k
;;
*)
antigen theme pure
;;
esac
In this scenario you have a couple of options:
- You may disable caching with
ANTIGEN_CACHE=false
(v2.1.0
and above). This will negatively affect start up time. - You may use cache for the different environments with
ANTIGEN_CACHE=$HOME/.antigen/init-${TERM}.zsh
for the above example.
You have to add this command after defining all bundles you need, in your zshrc. The completions defined by your bundles will be loaded at this step.
It is possible to load completions as and when a bundle is specified with the
bundle command, in which case this command would not be necessary. But loading
the completions is a time-consuming process, so if the completions were loaded
at every call to antigen bundle
, your shell will start noticeably slow when
you have a good number of bundle specifications.
However, if you can suggest a way so that this would not be necessary, I am very interested in discussing it. Please open up an issue with your details. Thanks.
Creates a snapshot of all the clones you currently have active including the
git version hash they are at and save it to a snapshot file. Active means, the
clones for those listed by antigen cleanup
are not included in the snapshot.
Takes one optional argument, the file name in which the snapshot is to be saved.
Defaults to antigen snapshot
.
Note: The snapshot currently only contains the details of those bundles
that have a clone. That is, bundles that have --no-local-clone
set or are
directly sourced from your file system (without a git repo), are not recorded
in the snapshot file.
Restore the bundles state as specified in the snapshot. Takes one required argument, the snapshot file name to read.
Although it restores the clones of the repos specified in the snapshot file, any other clones present in your environment are not touched. This behavior may change in the future.
Use this command to update your copy of antigen. It basically does a git pull
on your antigen's clone, if it is a git clone. Otherwise, it doesn't do
anything.
Takes no options.
Basic information for the most common commands. Go to our [Wiki][wiki] page for extended documentation on commands, workflows and configuration options.
Takes no options.
Wiki - Bug tracker - Roadmap - Contact - Copyright