Commit d6d8e5504b4319b07b317bee273fe78b45663650

Authored by Shrikant Sharat

Merge remote-tracking branch 'sheerun-fork/feature/command-style'

Conflicts:
	README.mkd

Conflict mainly due to the other pull request introducing the `antigen use`
command.

Showing 1 changed file Inline Diff

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