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 Side-by-side Diff

... ... @@ -30,7 +30,7 @@ There. You now have all the antigen goodies. Let's try install some plugins. How
30 30 about some color to start with. Get the [syntax highlighting plugin][] by
31 31 running
32 32  
33   - antigen-bundle zsh-users/zsh-syntax-highlighting
  33 + antigen bundle zsh-users/zsh-syntax-highlighting
34 34  
35 35 Now let it do its thing and once you're back at your prompt, try and type a
36 36 command. See that? Colors!
... ... @@ -38,9 +38,9 @@ command. See that? Colors!
38 38 So, you do git? ruby? git and ruby? There are lots of awesome plugins over at
39 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 42 # Or for the lazy,
43   - antigen-bundle git
  43 + antigen bundle git
44 44  
45 45 There are lots of plugins out there in the wild and people are writing zsh
46 46 utilities as small scripts all the time. Antigen is compatible with all of them.
... ... @@ -50,7 +50,7 @@ antigen.
50 50 Another example, [kennethreitz's autoenv][autoenv] (or [my fork][f-autoenv] of
51 51 it). Just a bundle command away.
52 52  
53   - antigen-bundle sharat87/autoenv
  53 + antigen bundle sharat87/autoenv
54 54  
55 55 And boom! you have all the autoenv goodness. Just remember how you used to do
56 56 these before antigen, clone it, modify your zshrc to source it, load a new
... ... @@ -62,22 +62,22 @@ github.
62 62  
63 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 67 No? Not your taste? There are many themes available to you, check out the
68 68 oh-my-zsh's [page on themes][].
69 69  
70 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 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 77 Note: Many of those plugins and especially themes, assume you have the core
78 78 library of oh-my-zsh loaded. So, if you want to experiment further, issue a
79 79  
80   - antigen-lib
  80 + antigen lib
81 81  
82 82 and continue until you're tired. At which point you can come back to this page
83 83 ;)
... ... @@ -95,30 +95,30 @@ git repo,
95 95 The usage should be very familiar to you if you use Vundle. A typical `.zshrc`
96 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 100 # Load the oh-my-zsh's library.
101   - antigen-lib
  101 + antigen lib
102 102  
103 103 # Bundles from the default repo (robbyrussell's oh-my-zsh).
104   - antigen-bundle git
105   - antigen-bundle heroku
106   - antigen-bundle pip
107   - antigen-bundle lein
108   - antigen-bundle command-not-found
  104 + antigen bundle git
  105 + antigen bundle heroku
  106 + antigen bundle pip
  107 + antigen bundle lein
  108 + antigen bundle command-not-found
109 109  
110 110 # Syntax highlighting bundle.
111   - antigen-bundle zsh-users/zsh-syntax-highlighting
  111 + antigen bundle zsh-users/zsh-syntax-highlighting
112 112  
113 113 # Load the theme.
114   - antigen-theme robbyrussell
  114 + antigen theme robbyrussell
115 115  
116 116 # Tell antigen that you're done.
117   - antigen-apply
  117 + antigen apply
118 118  
119 119 Open your zsh with this zshrc and you should see all the bundles you defined
120 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 123 You can find more examples in the wiki: [Antigen in the wild][wild].
124 124  
... ... @@ -149,32 +149,27 @@ pull request.
149 149  
150 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 154 and your prompt is changed, just for this session of course (unless you put this
155 155 line in your `.zshrc`).
156 156  
157 157 ## Commands
158 158  
159   -The following are the commands provided by antigen. Note that the `-` in the
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
  159 +### antigen bundle
165 160  
166 161 This command tells antigen to install (if not already installed) and load the
167 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 166 This will install and load the `plugins/<name>` directory from [robbyrussell's
172 167 oh-my-zsh][oh-my-zsh] (can be changed by setting `ANTIGEN_DEFAULT_REPO_URL`).
173 168  
174 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 174 where `<url>` is the repository url and it defaults to [robbyrussell's
180 175 oh-my-zsh][oh-my-zsh] repo (can be changed by setting `ANTIGEN_DEFAULT_REPO_URL`
... ... @@ -185,22 +180,22 @@ but it could contain a completion file or just many `*.zsh` files to be sourced.
185 180  
186 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 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 187 This would install the ant plugin from robbyrussell's oh-my-zsh repo. Of course,
193 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 192 And since this repo is the default, even that isn't necessary. But we can't
198 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 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 200 Which picks up the default for the `url` argument, and uses the `loc` given to
206 201 it.
... ... @@ -208,12 +203,12 @@ it.
208 203 *Note* that you can mix and match positional and keyword arguments. But you
209 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 208 And keyword arguments don't care about the order in which the arguments are
214 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 213 You can also specify a local directory on your file system as a bundle. In this
219 214 case, make sure the path you give is the absolute path (i.e., starts with a
... ... @@ -231,7 +226,7 @@ Other keyword-only arguments accepted:
231 226 used for this bundle (without the braces of course). The default is whatever
232 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 231 This will get the plugin as in the branch `develop`.
237 232  
... ... @@ -246,7 +241,7 @@ not given, even if the given repo url is a local path, a clone is made in the
246 241 this argument, the plugin is sourced straight from the repo location, without
247 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 246 Note that if the repo url is *not* an absolute local path or a branch has been
252 247 specified with the `--branch` option, this argument has no effect. That is,
... ... @@ -258,25 +253,25 @@ argument is forced as it doesn&#39;t makes sense to *clone* something that&#39;s not a
258 253 git repo. This property can be used to load any utility scripts you have in your
259 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 259 `btype` keyword-only argument, that is used internally. You shouldn't be
265 260 concerned with this argument, its only used internally and will probably go away
266 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
271   -look cumbersome. You can use the `antigen-bundles` command to *bulk* define
272   -bundles instead of individual calls to `antigen-bundle`.
  265 +If you have a fair number of bundles, using the `antigen bundle` command can
  266 +look cumbersome. You can use the `antigen bundles` command to *bulk* define
  267 +bundles instead of individual calls to `antigen bundle`.
273 268  
274 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
276   -`antigen-bundles` command. The easiest way to do this, is using the heredoc
  270 +you would give to the `antigen bundle` command, one per line, into the
  271 +`antigen bundles` command. The easiest way to do this, is using the heredoc
277 272 syntax.
278 273  
279   - antigen-bundles <<EOBUNDLES
  274 + antigen bundles <<EOBUNDLES
280 275 # Guess what to install when running an unknown command.
281 276 command-not-found
282 277  
... ... @@ -287,21 +282,21 @@ syntax.
287 282  
288 283 This is equivalent to
289 284  
290   - antigen-bundle command-not-found
291   - antigen-bundle heroku
  285 + antigen bundle command-not-found
  286 + antigen bundle heroku
292 287  
293   -Of course, as you can see, from the lines piped to `antigen-bundles`, empty
  288 +Of course, as you can see, from the lines piped to `antigen bundles`, empty
294 289 lines and those starting with a `#` are ignored. The rest are passed to
295   -`antigen-bundle` without any quoting rules applied. They are actually `eval`-ed
296   -with the `antigen-bundle` command. See the source if you want to really
  290 +`antigen bundle` without any quoting rules applied. They are actually `eval`-ed
  291 +with the `antigen bundle` command. See the source if you want to really
297 292 understand how it works. Its a very small function.
298 293  
299   -### antigen-update
  294 +### antigen update
300 295  
301 296 This is something you might not want to put in your `.zshrc`. Instead, run it
302 297 occasionally to update all your plugins. It doesn't take any arguments.
303 298  
304   - antigen-update
  299 + antigen update
305 300  
306 301 Please note that the updates that are downloaded are not immediately available.
307 302 You have to open a new shell to be able to see the changes. This is a limitation
... ... @@ -313,10 +308,10 @@ real quirky.
313 308 updating the bundles you are using with antigen. To update your copy of antigen,
314 309 use the `selfupdate` command described further below.
315 310  
316   -### antigen-revert <sup>&alpha;</sup>
  311 +### antigen revert <sup>&alpha;</sup>
317 312  
318 313 Reverts the state of all your plugins to how they were before the last
319   -`antigen-update`. This command is currently experimental, so don't rely too much
  314 +`antigen update`. This command is currently experimental, so don't rely too much
320 315 on it. There is a test for it, and it passes, so it should work fine though.
321 316  
322 317 Takes no options.
... ... @@ -324,7 +319,7 @@ Takes no options.
324 319 Insider detail: The information for reverting is stored in
325 320 `$ADOTDIR/revert-info` file. If its not present, reverting is not possible.
326 321  
327   -### antigen-list
  322 +### antigen list
328 323  
329 324 Use this command to list out the currently *loaded* plugins. Keep in mind that
330 325 this includes any bundles installed on-the-fly.
... ... @@ -340,7 +335,7 @@ The `btype` field is an internal detail, that specifies if the bundle is a
340 335 The final field is `true` or `false` reflecting whether there is a local clone
341 336 for this bundle.
342 337  
343   -### antigen-cleanup
  338 +### antigen cleanup
344 339  
345 340 Used to clean up the clones of repos which are not used by any plugins currently
346 341 loaded. It takes no arguments. When run, it lists out the repo-clones that are
... ... @@ -351,11 +346,11 @@ clones. If the `--force` argument is given, then this confirmation is not asked.
351 346 It straight away deletes all the unused clones. This option makes this command
352 347 usable in a non-interactive fashion.
353 348  
354   -### antigen-lib
  349 +### antigen lib
355 350  
356 351 This is (almost) the same as
357 352  
358   - antigen-bundle --loc=lib
  353 + antigen bundle --loc=lib
359 354  
360 355 So, it basically installs the oh-my-zsh's library as a bundle.
361 356  
... ... @@ -365,45 +360,45 @@ correct path, if not already set to something else.
365 360  
366 361 Please note that this assumes that the `ANTIGEN_DEFAULT_REPO_URL` is set to the
367 362 oh-my-zsh repo or a fork of that repo. If you want to specify the `url` too,
368   -then you can't use the `antigen-lib` short cut. You have to do that directly
369   -with the `antigen-bundle` command.
  363 +then you can't use the `antigen lib` short cut. You have to do that directly
  364 +with the `antigen bundle` command.
370 365  
371 366 This is present to ease dealing with oh-my-zsh plugins.
372 367  
373 368 Use
374 369  
375   - antigen-lib
  370 + antigen lib
376 371  
377   -in your `.zshrc`, before any `antigen-bundle` declarations. It takes no
  372 +in your `.zshrc`, before any `antigen bundle` declarations. It takes no
378 373 arguments.
379 374  
380   -### antigen-prezto-lib <sup>&alpha;</sup>
  375 +### antigen prezto-lib <sup>&alpha;</sup>
381 376  
382 377 This is (almost, but not quite) the same as doing,
383 378  
384   - antigen-bundle sorin-ionescu/prezto
  379 + antigen bundle sorin-ionescu/prezto
385 380  
386 381 That is, initializes the canonical repo of the prezto framework. Please note
387 382 that prezto support is very new and experimental in antigen. If you find any
388 383 bugs, please report over on github issues.
389 384  
390   -### antigen-theme
  385 +### antigen theme
391 386  
392 387 Used for switching the prompt theme. Invoke it with the name of the theme you
393 388 want to use.
394 389  
395   - antigen-theme fox
  390 + antigen theme fox
396 391  
397 392 This will get the theme file located at `themes/fox.zsh-theme` in the repo
398 393 specified by `ANTIGEN_DEFAULT_REPO_URL`.
399 394  
400   -To pull themes from other repositories, use `antigen-theme` just like
401   -`antigen-bundle`. Exactly the same, just make sure the `url` and `loc`
  395 +To pull themes from other repositories, use `antigen theme` just like
  396 +`antigen bundle`. Exactly the same, just make sure the `url` and `loc`
402 397 combination point to a theme file, having a `.zsh-theme` extension.
403 398  
404 399 For example,
405 400  
406   - antigen-theme robbyrussell/oh-my-zsh themes/apple
  401 + antigen theme robbyrussell/oh-my-zsh themes/apple
407 402  
408 403 Will pull the apple theme from the canonical oh-my-zsh repo. Also, note that the
409 404 `.zsh-theme` extension is not present. It can be given, its optional.
... ... @@ -411,14 +406,14 @@ Will pull the apple theme from the canonical oh-my-zsh repo. Also, note that the
411 406 You can use this command to change your theme on the fly in your shell. Go on,
412 407 try out a few themes in your shell before you set it in your `.zshrc`.
413 408  
414   -**Note**: Some themes use functions that are loaded by `antigen-lib`. So, to
415   -avoid any trouble, run `antigen-lib` if you haven't already before experimenting
416   -with themes. If you have `antigen-lib` in your `.zshrc`, you're covered.
  409 +**Note**: Some themes use functions that are loaded by `antigen lib`. So, to
  410 +avoid any trouble, run `antigen lib` if you haven't already before experimenting
  411 +with themes. If you have `antigen lib` in your `.zshrc`, you're covered.
417 412  
418   -**Note**: Do *not* provide the `--btype` argument to `antigen-theme`. Its an
  413 +**Note**: Do *not* provide the `--btype` argument to `antigen theme`. Its an
419 414 internal argument.
420 415  
421   -### antigen-apply
  416 +### antigen apply
422 417  
423 418 You have to add this command after defining all bundles you need, in your zshrc.
424 419 The completions defined by your bundles will be loaded at this step.
... ... @@ -426,27 +421,27 @@ The completions defined by your bundles will be loaded at this step.
426 421 It is possible to load completions as and when a bundle is specified with the
427 422 bundle command, in which case this command would not be necessary. But loading
428 423 the completions is a time-consuming process, so if the completions were loaded
429   -at every call to `antigen-bundle`, your shell will start noticeably slow when
  424 +at every call to `antigen bundle`, your shell will start noticeably slow when
430 425 you have a good number of bundle specifications.
431 426  
432 427 However, if you can suggest a way so that this would not be necessary, I am very
433 428 interested in discussing it. Please open up an issue with your details. Thanks.
434 429  
435   -### antigen-snapshot <sup>&alpha;</sup>
  430 +### antigen snapshot <sup>&alpha;</sup>
436 431  
437 432 Creates a snapshot of all the clones you currently have *active* including the
438 433 git version hash they are at and save it to a snapshot file. *Active* means, the
439   -clones for those listed by `antigen-cleanup` are not included in the snapshot.
  434 +clones for those listed by `antigen cleanup` are not included in the snapshot.
440 435  
441 436 Takes one optional argument, the file name in which the snapshot is to be saved.
442   -Defaults to `antigen-snapshot`.
  437 +Defaults to `antigen snapshot`.
443 438  
444 439 **Note**: The snapshot currently *only* contains the details of those bundles
445 440 that have a clone. That is, bundles that have `--no-local-clone` set or are
446 441 directly sourced from your file system (without a git repo), are not recorded
447 442 in the snapshot file.
448 443  
449   -### antigen-restore <sup>&alpha;</sup>
  444 +### antigen restore <sup>&alpha;</sup>
450 445  
451 446 Restore the bundles state as specified in the snapshot. Takes one required
452 447 argument, the snapshot file name to read.
... ... @@ -455,7 +450,7 @@ Although it restores the clones of the repos specified in the snapshot file, any
455 450 other clones present in your environment are not touched. This behavior may
456 451 change in the future.
457 452  
458   -### antigen-selfupdate
  453 +### antigen selfupdate
459 454  
460 455 Use this command to update your copy of antigen. It basically does a `git pull`
461 456 on your antigen's clone, *if* it is a git clone. Otherwise, it doesn't do
... ... @@ -463,7 +458,7 @@ anything.
463 458  
464 459 Takes no options.
465 460  
466   -### antigen-help
  461 +### antigen help
467 462  
468 463 This exists so that there can be some help right in the command line. Currently
469 464 it doesn't provide much help other than redirecting you to the project page for
... ... @@ -473,34 +468,6 @@ help in the future.
473 468 I could use some help here as I'm not that good at writing documentation that
474 469 looks good as output on the command line.
475 470  
476   -### antigen
477   -
478   -This is a parent command that mainly exists for convenience. This exists so the
479   -following two can be the same.
480   -
481   - antigen-list
482   - antigen list
483   -
484   -and
485   -
486   - antigen-help
487   - antigen help
488   -
489   -Because of this, we can create aliases like
490   -
491   - alias a=antigen
492   - alias an=antigen
493   -
494   -and run the antigen commands without making them look annoyingly long.
495   -
496   - a bundle ruby
497   - a theme candy
498   - a list
499   -
500   -And even...
501   -
502   - an update
503   -
504 471 ## Configuration
505 472  
506 473 The following environment variables can be set to customize the behavior of