Blame view
README.mkd
22.9 KB
|
c60bdf384
|
1 |
# Antigen <sup>β</sup> |
|
b84833b4c
|
2 |
|
|
ec7f137bb
|
3 |
[](http://travis-ci.org/zsh-users/antigen) |
|
b84833b4c
|
4 5 6 |
Antigen is a small set of functions that help you easily manage your shell (zsh) plugins, called bundles. The concept is pretty much the same as bundles in a typical vim+pathogen setup. Antigen is to zsh, what [Vundle][] is to vim. |
|
015b9e5e9
|
7 |
Please note that this is a very new project and can be considered beta at best. |
|
63088f869
|
8 9 10 11 |
That said, I am using antigen full time now on my work machine. Note: Please read the commit comments of the changesets when you pull a new version of antigen. |
|
e1bf049d8
|
12 |
|
|
ac6ddd7d4
|
13 |
## Show off |
|
8f0e534f1
|
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
> Enough talk. Let's fight!
> -- Po, Kung-fu Panda.
You're going to experience antigen right in your open shell. No `.zshrc`
tweaking and reading the rest of this documentation. Kinda like an ice-cream
sample, if you will.
Get and load antigen.
curl https://raw.github.com/zsh-users/antigen/master/antigen.zsh > antigen.zsh
source antigen.zsh
There. You now have all the antigen goodies. Let's try install some plugins. How
|
|
b36de9bb3
|
28 29 |
about some color to start with. Get the [syntax highlighting plugin][] by running |
|
8f0e534f1
|
30 |
|
|
05cfb1bc3
|
31 |
antigen bundle zsh-users/zsh-syntax-highlighting |
|
8f0e534f1
|
32 |
|
|
63088f869
|
33 34 |
Now let it do its thing and once you're back at your prompt, try and type a command. See that? Colors! |
|
8f0e534f1
|
35 36 37 |
So, you do git? ruby? git and ruby? There are lots of awesome plugins over at oh-my-zsh. Treat yourself to some. |
|
05cfb1bc3
|
38 |
antigen bundle robbyrussell/oh-my-zsh plugins/ruby |
|
63088f869
|
39 |
# Or for the lazy, |
|
05cfb1bc3
|
40 |
antigen bundle git |
|
8f0e534f1
|
41 42 43 44 45 |
There are lots of plugins out there in the wild and people are writing zsh utilities as small scripts all the time. Antigen is compatible with all of them. The plugins and scripts don't need any special handling to be compatible with antigen. |
|
6e2c0fbd6
|
46 47 |
Another example, [kennethreitz's autoenv][autoenv] (or [my fork][f-autoenv] of it). Just a bundle command away. |
|
3e16c4709
|
48 |
|
|
05cfb1bc3
|
49 |
antigen bundle sharat87/autoenv |
|
3e16c4709
|
50 51 |
And boom! you have all the autoenv goodness. Just remember how you used to do |
|
dc81603ff
|
52 |
these before antigen, clone it, modify your zshrc to source it, load a new |
|
3e16c4709
|
53 |
terminal, all just to test it out. Duh! |
|
63088f869
|
54 |
A subtle aspect of this is that you can tell antigen to grab just about anything |
|
8f0e534f1
|
55 56 57 58 |
from anyone's `dotfiles` repo, as long as it is in a directory under any repo on github. And themes? How would you like a fancy new prompt for yourself? |
|
05cfb1bc3
|
59 |
antigen theme funky |
|
8f0e534f1
|
60 61 |
No? Not your taste? There are many themes available to you, check out the |
|
149b3e8f1
|
62 63 64 |
oh-my-zsh's [page on themes][]. You can install themes from unofficial repos too! |
|
05cfb1bc3
|
65 |
antigen theme XsErG/zsh-themes themes/lazyuser |
|
149b3e8f1
|
66 |
|
|
d6da630cf
|
67 68 |
See? It's easy! To see how that works, refer to [the section on the `antigen theme` command further down](#antigen-theme). |
|
8f0e534f1
|
69 70 71 |
Note: Many of those plugins and especially themes, assume you have the core library of oh-my-zsh loaded. So, if you want to experiment further, issue a |
|
d6d8e5504
|
72 |
antigen use oh-my-zsh |
|
8f0e534f1
|
73 74 75 |
and continue until you're tired. At which point you can come back to this page ;) |
|
ac6ddd7d4
|
76 |
## Usage |
|
8f0e534f1
|
77 |
|
|
63088f869
|
78 |
So, now that you're here, I suppose you are convinced and want antigen running |
|
8f0e534f1
|
79 |
your shell all the time. Sweet. Let's do it. |
|
b84833b4c
|
80 |
|
|
3c698aac0
|
81 82 |
First, clone this repo, probably as a submodule if you have your dotfiles in a git repo, |
|
fa33fe578
|
83 |
git clone https://github.com/zsh-users/antigen.git |
|
3c698aac0
|
84 |
|
|
b84833b4c
|
85 86 |
The usage should be very familiar to you if you use Vundle. A typical `.zshrc` might look like this |
|
05cfb1bc3
|
87 |
source /path-to-antigen clone/antigen.zsh |
|
b84833b4c
|
88 89 |
# Load the oh-my-zsh's library.
|
|
d6d8e5504
|
90 |
antigen use oh-my-zsh |
|
b84833b4c
|
91 92 |
# Bundles from the default repo (robbyrussell's oh-my-zsh).
|
|
05cfb1bc3
|
93 94 95 96 97 |
antigen bundle git
antigen bundle heroku
antigen bundle pip
antigen bundle lein
antigen bundle command-not-found
|
|
b84833b4c
|
98 99 |
# Syntax highlighting bundle.
|
|
05cfb1bc3
|
100 |
antigen bundle zsh-users/zsh-syntax-highlighting |
|
b84833b4c
|
101 102 |
# Load the theme.
|
|
05cfb1bc3
|
103 |
antigen theme robbyrussell |
|
b84833b4c
|
104 |
|
|
1af74ea9e
|
105 |
# Tell antigen that you're done. |
|
05cfb1bc3
|
106 |
antigen apply |
|
1af74ea9e
|
107 |
|
|
7ba3548fd
|
108 109 |
Open your zsh with this zshrc and you should see all the bundles you defined here, getting installed. Once its done, you are ready to roll. The complete |
|
05cfb1bc3
|
110 |
syntax for the `antigen bundle` command is discussed further down on this page. |
|
b84833b4c
|
111 |
|
|
08e06125d
|
112 |
You can find more examples in the wiki: [Antigen in the wild][wild]. |
|
ac6ddd7d4
|
113 |
## Motivation |
|
b84833b4c
|
114 115 |
If you use zsh and [oh-my-zsh][], you know that having many different plugins |
|
63088f869
|
116 |
that are developed by many different authors in a single (sub)repo is not very |
|
b84833b4c
|
117 118 |
easy to maintain. There are some really fantastic plugins and utilities in oh-my-zsh, but having them all in a single repo doesn't really scale well. And I |
|
7ba3548fd
|
119 |
admire robbyrussell's efforts for reviewing and merging the gigantic number of |
|
63088f869
|
120 |
pull requests the project gets. We need a better way of plugin management. |
|
b84833b4c
|
121 122 123 124 125 126 127 128 129 130 131 132 133 |
This was discussed on [a][1] [few][2] [issues][3], but it doesn't look like there was any progress made. So, I'm trying to start this off with antigen, hoping to better this situation. Please note that I'm by no means a zsh or any shell script expert (far from it). [1]: https://github.com/robbyrussell/oh-my-zsh/issues/465 [2]: https://github.com/robbyrussell/oh-my-zsh/issues/377 [3]: https://github.com/robbyrussell/oh-my-zsh/issues/1014 Inspired by vundle, antigen can pull oh-my-zsh style plugins from various github repositories. You are not limited to use plugins from the oh-my-zsh repository only and you don't need to maintain your own fork and pull from upstream every |
|
63088f869
|
134 135 136 |
now and then. I actually encourage you to grab plugins and scripts from various sources, straight from the authors, before they even submit it to oh-my-zsh as a pull request. |
|
b84833b4c
|
137 138 |
Antigen also lets you switch the prompt theme with one command, just like that |
|
05cfb1bc3
|
139 |
antigen theme candy |
|
b84833b4c
|
140 |
|
|
63088f869
|
141 142 |
and your prompt is changed, just for this session of course (unless you put this line in your `.zshrc`). |
|
b84833b4c
|
143 |
|
|
ac6ddd7d4
|
144 |
## Commands |
|
b84833b4c
|
145 |
|
|
05cfb1bc3
|
146 |
### antigen bundle |
|
b84833b4c
|
147 |
|
|
7ba3548fd
|
148 149 |
This command tells antigen to install (if not already installed) and load the given plugin. The simplest usage follows the following syntax. |
|
b84833b4c
|
150 |
|
|
05cfb1bc3
|
151 |
antigen bundle <plugin-name> |
|
7e0aca7ce
|
152 |
|
|
63088f869
|
153 |
This will install and load the `plugins/<name>` directory from [robbyrussell's |
|
7e0aca7ce
|
154 |
oh-my-zsh][oh-my-zsh] (can be changed by setting `ANTIGEN_DEFAULT_REPO_URL`). |
|
2fe4683b3
|
155 |
However, the above is just syntax sugar for the extended syntax of the |
|
05cfb1bc3
|
156 |
`antigen bundle` command. |
|
7e0aca7ce
|
157 |
|
|
05cfb1bc3
|
158 |
antigen bundle [<url> [<loc>]] |
|
b84833b4c
|
159 160 |
where `<url>` is the repository url and it defaults to [robbyrussell's |
|
7ba3548fd
|
161 162 163 164 165 |
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. `<loc>` defaults to `/`, which indicates the repository itself is a plugin. |
|
b84833b4c
|
166 167 |
An example invocation would be |
|
05cfb1bc3
|
168 |
# The following is the same as `antigen bundle ant`. But for demonstration |
|
2fe4683b3
|
169 |
# purposes, we use the extended syntax here. |
|
05cfb1bc3
|
170 |
antigen bundle https://github.com/robbyrussell/oh-my-zsh.git plugins/ant |
|
b84833b4c
|
171 |
|
|
7ba3548fd
|
172 173 |
This would install the ant plugin from robbyrussell's oh-my-zsh repo. Of course, github url's can be shortened. |
|
b84833b4c
|
174 |
|
|
05cfb1bc3
|
175 |
antigen bundle robbyrussell/oh-my-zsh plugins/ant |
|
b84833b4c
|
176 |
|
|
7ba3548fd
|
177 178 |
And since this repo is the default, even that isn't necessary. But we can't specify the `loc` without giving the first argument. |
|
b84833b4c
|
179 |
|
|
05cfb1bc3
|
180 |
For this and a few other reasons, `antigen bundle` also supports a simple |
|
2fe4683b3
|
181 |
keyword argument syntax, using which we can rewrite the above as |
|
b84833b4c
|
182 |
|
|
05cfb1bc3
|
183 |
antigen bundle --loc=plugins/ant |
|
b84833b4c
|
184 |
|
|
7ba3548fd
|
185 186 |
Which picks up the default for the `url` argument, and uses the `loc` given to it. |
|
7e0aca7ce
|
187 |
|
|
7ba3548fd
|
188 189 |
*Note* that you can mix and match positional and keyword arguments. But you can't have positional arguments after keyword arguments. |
|
b84833b4c
|
190 |
|
|
05cfb1bc3
|
191 |
antigen bundle robbyrussell/oh-my-zsh --loc=plugins/ant |
|
b84833b4c
|
192 193 194 |
And keyword arguments don't care about the order in which the arguments are specified. The following is perfectly valid. |
|
05cfb1bc3
|
195 |
antigen bundle --loc=plugins/ant --url=robbyrussell/oh-my-zsh |
|
5e26a8e26
|
196 |
|
|
e97773908
|
197 198 199 200 |
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 |
|
e6cc15b5f
|
201 |
refer to the notes on `--no-local-clone` below. |
|
e97773908
|
202 |
|
|
63088f869
|
203 204 205 |
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`. |
|
5e26a8e26
|
206 |
|
|
4129490ce
|
207 |
Other keyword-only arguments accepted: |
|
8a80d2b7a
|
208 209 210 |
`--branch={git-branch-name}` — 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,
|
|
05cfb1bc3
|
211 |
antigen bundle github-user/repo --branch=develop |
|
8a80d2b7a
|
212 213 214 215 216 217 218 219 220 221 222 223 224 |
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 `$ADOTDIR/repos`, 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, |
|
05cfb1bc3
|
225 |
antigen bundle /absolute/path/to/the/plugin --no-local-clone |
|
8a80d2b7a
|
226 |
|
|
e6cc15b5f
|
227 228 229 230 |
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. |
|
4129490ce
|
231 |
|
|
e97773908
|
232 233 234 235 |
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, |
|
05cfb1bc3
|
236 |
antigen bundle $HOME/dotfiles/oh-my-zsh/custom |
|
e97773908
|
237 |
|
|
05cfb1bc3
|
238 |
In addition to the above discussed arguments, `antigen bundle` also takes a |
|
63088f869
|
239 240 241 |
`btype` keyword-only argument, that is used internally. You shouldn't be concerned with this argument, its only used internally and will probably go away in the future. It indicates whether the bundle is a theme or a simple plugin. |
|
05cfb1bc3
|
242 |
### antigen bundles |
|
78ea5a9f4
|
243 |
|
|
05cfb1bc3
|
244 245 246 |
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`. |
|
78ea5a9f4
|
247 248 |
Usage is pretty straightforward. Just pipe the bundle specifications, just as |
|
05cfb1bc3
|
249 250 |
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 |
|
78ea5a9f4
|
251 |
syntax. |
|
05cfb1bc3
|
252 |
antigen bundles <<EOBUNDLES |
|
ffad68b97
|
253 254 |
# Guess what to install when running an unknown command.
command-not-found
|
|
78ea5a9f4
|
255 |
|
|
ffad68b97
|
256 257 |
# The heroku tool helper plugin.
heroku
|
|
63088f869
|
258 |
EOBUNDLES |
|
78ea5a9f4
|
259 260 |
This is equivalent to |
|
05cfb1bc3
|
261 262 |
antigen bundle command-not-found
antigen bundle heroku
|
|
78ea5a9f4
|
263 |
|
|
05cfb1bc3
|
264 |
Of course, as you can see, from the lines piped to `antigen bundles`, empty |
|
78ea5a9f4
|
265 |
lines and those starting with a `#` are ignored. The rest are passed to |
|
05cfb1bc3
|
266 267 |
`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 |
|
78ea5a9f4
|
268 |
understand how it works. Its a very small function. |
|
57819c9aa
|
269 270 |
*Note*: Indenting the contents inside the EOBUNDLES heredoc is not required for antigen-bundles to work. Its allowed (and encouraged) to improve readability. |
|
05cfb1bc3
|
271 |
### antigen update |
|
5e26a8e26
|
272 |
|
|
7ba3548fd
|
273 274 |
This is something you might not want to put in your `.zshrc`. Instead, run it occasionally to update all your plugins. It doesn't take any arguments. |
|
5e26a8e26
|
275 |
|
|
05cfb1bc3
|
276 |
antigen update |
|
5e26a8e26
|
277 |
|
|
7ba3548fd
|
278 279 280 281 282 |
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. |
|
b84833b4c
|
283 |
|
|
2fe4683b3
|
284 |
**Please note**: This command is not for updating *antigen* itself. Its for |
|
3201f76b9
|
285 286 |
updating the bundles you are using with antigen. To update your copy of antigen, use the `selfupdate` command described further below. |
|
2fe4683b3
|
287 |
|
|
05cfb1bc3
|
288 |
### antigen revert <sup>α</sup> |
|
8cf9a21d1
|
289 290 |
Reverts the state of all your plugins to how they were before the last |
|
05cfb1bc3
|
291 |
`antigen update`. This command is currently experimental, so don't rely too much |
|
8cf9a21d1
|
292 293 294 295 296 297 |
on it. There is a test for it, and it passes, so it should work fine though. Takes no options. Insider detail: The information for reverting is stored in `$ADOTDIR/revert-info` file. If its not present, reverting is not possible. |
|
05cfb1bc3
|
298 |
### antigen list |
|
de2f0c562
|
299 |
|
|
7ba3548fd
|
300 301 |
Use this command to list out the currently *loaded* plugins. Keep in mind that this includes any bundles installed on-the-fly. |
|
de2f0c562
|
302 |
|
|
63088f869
|
303 304 305 306 307 308 309 310 311 312 |
Takes no arguments. Gives out four entries per line of output, denoting the
following fields of each bundle.
<repo-url> <loc> <btype> <has-local-clone?>
The `btype` field is an internal detail, that specifies if the bundle is a
`plugin` or a `theme`.
The final field is `true` or `false` reflecting whether there is a local clone
for this bundle.
|
|
de2f0c562
|
313 |
|
|
05cfb1bc3
|
314 |
### antigen cleanup |
|
b84833b4c
|
315 |
|
|
63088f869
|
316 317 318 |
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*. |
|
b84833b4c
|
319 |
|
|
7f742ef26
|
320 321 322 323 |
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. |
|
b84833b4c
|
324 |
|
|
b5516f331
|
325 326 327 328 329 330 331 332 333 334 335 |
### antigen use
This command lets you load any (supported) zsh pre-packaged framework, like
oh-my-zsh. 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.
#### oh-my-zsh
|
|
b84833b4c
|
336 |
|
|
c3198e0aa
|
337 |
This is (almost) the same as |
|
7ba3548fd
|
338 |
|
|
05cfb1bc3
|
339 |
antigen bundle --loc=lib |
|
7ba3548fd
|
340 |
|
|
63088f869
|
341 |
So, it basically installs the oh-my-zsh's library as a bundle. |
|
c3198e0aa
|
342 343 344 |
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. |
|
63088f869
|
345 346 |
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, |
|
d6d8e5504
|
347 348 |
then you can't use the `antigen use oh-my-zsh` short cut. You have to do that directly with the `antigen bundle` command. |
|
7ba3548fd
|
349 |
|
|
7ba3548fd
|
350 |
Use |
|
b84833b4c
|
351 |
|
|
d6d8e5504
|
352 |
antigen use oh-my-zsh |
|
b84833b4c
|
353 |
|
|
b5516f331
|
354 |
in your `.zshrc`, before any `antigen bundle` declarations. It takes no further |
|
2fe4683b3
|
355 |
arguments. |
|
b84833b4c
|
356 |
|
|
b5516f331
|
357 |
#### prezto |
|
bac244cc1
|
358 359 |
This is (almost, but not quite) the same as doing, |
|
05cfb1bc3
|
360 |
antigen bundle sorin-ionescu/prezto |
|
bac244cc1
|
361 362 363 364 |
That is, initializes the canonical repo of the prezto framework. Please note that prezto support is very new and experimental in antigen. If you find any bugs, please report over on github issues. |
|
b5516f331
|
365 |
Takes no further arguments. |
|
05cfb1bc3
|
366 |
### antigen theme |
|
b84833b4c
|
367 368 369 |
Used for switching the prompt theme. Invoke it with the name of the theme you want to use. |
|
05cfb1bc3
|
370 |
antigen theme fox |
|
b84833b4c
|
371 |
|
|
fb91d6087
|
372 373 |
This will get the theme file located at `themes/fox.zsh-theme` in the repo specified by `ANTIGEN_DEFAULT_REPO_URL`. |
|
05cfb1bc3
|
374 375 |
To pull themes from other repositories, use `antigen theme` just like `antigen bundle`. Exactly the same, just make sure the `url` and `loc` |
|
fb91d6087
|
376 377 378 |
combination point to a theme file, having a `.zsh-theme` extension. For example, |
|
05cfb1bc3
|
379 |
antigen theme robbyrussell/oh-my-zsh themes/apple |
|
fb91d6087
|
380 381 382 |
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. |
|
b84833b4c
|
383 |
|
|
fbf7e37c3
|
384 385 386 |
To get themes from arbitrary git repos (such as gists) use,
antigen theme https://gist.github.com/3750104.git agnoster
|
|
7ba3548fd
|
387 388 |
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`. |
|
d6d8e5504
|
389 390 391 |
**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 |
|
843a7ea31
|
392 |
`.zshrc`, you're covered. |
|
63088f869
|
393 |
|
|
05cfb1bc3
|
394 |
**Note**: Do *not* provide the `--btype` argument to `antigen theme`. Its an |
|
fb91d6087
|
395 |
internal argument. |
|
05cfb1bc3
|
396 |
### antigen apply |
|
1af74ea9e
|
397 398 399 400 401 402 |
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 |
|
63088f869
|
403 |
the completions is a time-consuming process, so if the completions were loaded |
|
05cfb1bc3
|
404 |
at every call to `antigen bundle`, your shell will start noticeably slow when |
|
63088f869
|
405 |
you have a good number of bundle specifications. |
|
1af74ea9e
|
406 |
|
|
63088f869
|
407 408 |
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. |
|
1af74ea9e
|
409 |
|
|
05cfb1bc3
|
410 |
### antigen snapshot <sup>α</sup> |
|
fb74da6ce
|
411 412 413 |
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 |
|
05cfb1bc3
|
414 |
clones for those listed by `antigen cleanup` are not included in the snapshot. |
|
fb74da6ce
|
415 416 |
Takes one optional argument, the file name in which the snapshot is to be saved. |
|
05cfb1bc3
|
417 |
Defaults to `antigen snapshot`. |
|
fb74da6ce
|
418 419 420 421 422 |
**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. |
|
05cfb1bc3
|
423 |
### antigen restore <sup>α</sup> |
|
fb74da6ce
|
424 425 426 427 428 429 430 |
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. |
|
05cfb1bc3
|
431 |
### antigen selfupdate |
|
3201f76b9
|
432 433 434 435 436 437 |
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. |
|
05cfb1bc3
|
438 |
### antigen help |
|
4a1cecfff
|
439 440 441 442 443 444 445 446 |
This exists so that there can be some help right in the command line. Currently it doesn't provide much help other than redirecting you to the project page for documentation. It is intended to provide more meaning and sub-command specific help in the future. I could use some help here as I'm not that good at writing documentation that looks good as output on the command line. |
|
ac6ddd7d4
|
447 |
## Configuration |
|
b84833b4c
|
448 449 |
The following environment variables can be set to customize the behavior of |
|
7ba3548fd
|
450 |
antigen. Make sure you set them *before* source-ing `antigen.zsh`. |
|
b84833b4c
|
451 452 453 454 |
`ANTIGEN_DEFAULT_REPO_URL` — This is the default repository url that is used for `bundle` commands. The default value is robbyrussell's oh-my-zsh repo, but you can set this to the fork url of your own fork. |
|
911cc8cb5
|
455 456 457 |
`ADOTDIR` — This directory is used to store all the repo clones, your bundles, themes, caches and everything else antigen requires to run smoothly. Defaults to `$HOME/.antigen`. |
|
b84833b4c
|
458 |
|
|
911cc8cb5
|
459 460 461 |
**Note**: `ANTIGEN_REPO_CACHE` & `ANTIGEN_BUNDLE_DIR` — These variables were used previously but are now removed. Please use `ADOTDIR` instead, as mentioned above. |
|
b84833b4c
|
462 |
|
|
72e36b84e
|
463 |
## Running the tests |
|
79953f965
|
464 |
All the tests are in the `tests` folder and are run using the [cram][] test |
|
dbbcf97bc
|
465 466 467 |
system. The latest version on that website, as of today is v0.5, which does not have the `--shell` argument which is required to run our tests. So, to get the correct version of cram, run |
|
72e36b84e
|
468 |
|
|
dbbcf97bc
|
469 |
pip install -r requirements.txt |
|
72e36b84e
|
470 |
|
|
dbbcf97bc
|
471 |
With that, once you have cram installed, you can run the tests as |
|
72e36b84e
|
472 |
|
|
dbbcf97bc
|
473 |
make |
|
72e36b84e
|
474 475 476 477 478 |
If you are making a feature addition, I'd really appreciate if you can add a test for your feature. Even if you can add a test for an existing feature, that would be great as the tests are currently seriously lagging behind the full functionality of antigen. |
|
ac6ddd7d4
|
479 |
## Notes on writing plugins |
|
b36de9bb3
|
480 |
|
|
b33b9e9d4
|
481 482 483 484 485 486 487 |
Most shell utilities/plugins are made up of just one file. For a plugin called `awesomeness`, create a `awesomeness.plugin.zsh` and code away. That said, even if you write a single file as a `.sh` file with the goodness you want to create, antigen will work just fine with it. The `*.plugin.zsh` way is recommended by antigen, because it is widely used because of the [oh-my-zsh][] project. |
|
18249921c
|
488 489 490 491 |
If you want to know how antigen loads the plugins, do continue. Firstly, antigen looks for a `*.plugin.zsh` file in the plugin directory. If |
|
bac244cc1
|
492 493 494 495 496 497 |
present, it will source *only* this script. Nothing else is sourced. This is for oh-my-zsh style plugins. Secondly, it looks for a `init.zsh` file in the plugin directory. If present, it will source *only* this script. Nothing else is sourced. This is for prezto style modules. |
|
18249921c
|
498 499 500 501 502 503 504 505 506 507 508 |
Otherwise, it looks for `*.zsh` files and if there are any, *all* of them are sourced. The order in which they are sourced is not currently defined. Please don't rely on this order. Nothing else is sourced after all the `*.zsh` scripts. If no `*.zsh` files are present, it finally looks for any `*.sh` files and sources *all* of them. Again, the order in which they are sourced in not currently defined. No matter which (or none) of the above happen to be sourced, this plugin directory is added to the zsh's function path (`$fpath`) so that any completions |
|
63088f869
|
509 510 511 512 513 |
in it are loaded. One exception to this rule is that if this plugin is a theme. In which case the theme script is just sourced and nothing else is done. Not even adding to `$fpath`. |
|
b36de9bb3
|
514 |
|
|
e6888036d
|
515 516 517 518 519 520 521 522 523 524 525 |
## A note on external zsh plugins Antigen downloads zsh scripts and sources them, according to your specifications. As such, these scripts are capable of doing some *real* damage to your system. If you are only downloading scripts from oh-my-zsh and/or prezto, you're probably fine, since there is a second level of manual checking before a script gets into the framework. But, if you are adding a script from any other source, please check the source code of the plugin to see its not doing anything malicious, before adding it to your `.zshrc`. |
|
ac6ddd7d4
|
526 |
## Meta |
|
b84833b4c
|
527 |
|
|
72e36b84e
|
528 |
### Helping out |
|
dd62b3331
|
529 530 531 532 533 |
Antigen is licensed with the [MIT License][license]. To contribute, please read the [contributing wiki page][contributing] before sending pull requests. If its a long/complicated change, please consider opening an [issue][] first so we can discuss it out. Thanks! |
|
b84833b4c
|
534 |
|
|
72e36b84e
|
535 |
### Feedback please |
|
f76ba3b6c
|
536 537 538 |
Any comments/suggestions/feedback welcome. Please say hello to me ([@sharat87][twitter]) on twitter. Or open an issue to discuss something (anything!) about the project ;). |
|
5c124ed5a
|
539 |
|
|
f1387e5be
|
540 |
|
|
b84833b4c
|
541 |
[Vundle]: https://github.com/gmarik/vundle |
|
b36de9bb3
|
542 |
[page on themes]: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
|
08e06125d
|
543 |
[wild]: https://github.com/zsh-users/antigen/wiki/In-the-wild |
|
b36de9bb3
|
544 |
[syntax highlighting plugin]: https://github.com/zsh-users/zsh-syntax-highlighting |
|
3e16c4709
|
545 |
[autoenv]: https://github.com/kennethreitz/autoenv |
|
6e2c0fbd6
|
546 |
[f-autoenv]: https://github.com/sharat87/autoenv |
|
b84833b4c
|
547 |
[oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh |
|
72e36b84e
|
548 |
[cram]: https://bitheap.org/cram/ |
|
290edb005
|
549 |
[issue]: https://github.com/zsh-users/antigen/issues |
|
7ba3548fd
|
550 |
[license]: http://mit.sharats.me |
|
dd62b3331
|
551 |
[contributing]: https://github.com/zsh-users/antigen/wiki/Contributing |
|
7ba3548fd
|
552 |
[twitter]: http://twitter.com/sharat87 |