Blame view

README.mkd 19.6 KB
c60bdf384   Shrikant Sharat   Add beta label to...
1
  # Antigen <sup>&beta;</sup>
b84833b4c   Shrikant Sharat   Add readme.
2
3
4
5
  
  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   Shrikant Sharat   Pronouns, please.
6
  Please note that this is a very new project and can be considered beta at best.
63088f869   Shrikant Sharat   Proof read README.
7
8
9
10
  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   Shrikant Sharat   Add alpha notice ...
11

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
12
  ## Show off
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  
  > 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   Shrikant Sharat   Add links in READ...
27
28
  about some color to start with. Get the [syntax highlighting plugin][] by
  running
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
29
30
  
      antigen-bundle zsh-users/zsh-syntax-highlighting
63088f869   Shrikant Sharat   Proof read README.
31
32
  Now let it do its thing and once you're back at your prompt, try and type a
  command. See that? Colors!
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
33
34
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.
  
      antigen-bundle robbyrussell/oh-my-zsh plugins/ruby
63088f869   Shrikant Sharat   Proof read README.
38
39
      # Or for the lazy,
      antigen-bundle git
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
40
41
42
43
44
  
  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.
1e80c2b5c   Odin Dutton   Fix link to @kenn...
45
  Another example, [kennethreitz's autoenv][autoenv]. Just a bundle command away.
3e16c4709   Shrikant Sharat   Add autoenv as an...
46
47
48
49
50
51
  
      antigen-bundle kennethreitz/autoenv
  
  And boom! you have all the autoenv goodness. Just remember how you used to do
  these before antigen, clone it, modify your bashrc to source it, load a new
  terminal, all just to test it out. Duh!
63088f869   Shrikant Sharat   Proof read README.
52
  A subtle aspect of this is that you can tell antigen to grab just about anything
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
53
54
55
56
57
58
59
60
  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?
  
      antigen-theme funky
  
  No? Not your taste? There are many themes available to you, check out the
b36de9bb3   Shrikant Sharat   Add links in READ...
61
  oh-my-zsh's [page on themes][]. (You can currently only install themes from
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
62
63
64
65
66
67
68
69
70
  robbyrussell's, i.e., the canonical oh-my-zsh repo).
  
  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
  
      antigen-lib
  
  and continue until you're tired. At which point you can come back to this page
  ;)
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
71
  ## Usage
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
72

63088f869   Shrikant Sharat   Proof read README.
73
  So, now that you're here, I suppose you are convinced and want antigen running
8f0e534f1   Shrikant Sharat   Added 'Show off' ...
74
  your shell all the time. Sweet. Let's do it.
b84833b4c   Shrikant Sharat   Add readme.
75

3c698aac0   Shrikant Sharat   Add information o...
76
77
  First, clone this repo, probably as a submodule if you have your dotfiles in a
  git repo,
fa33fe578   Arash Rouhani   Change clone url ...
78
      git clone https://github.com/zsh-users/antigen.git
3c698aac0   Shrikant Sharat   Add information o...
79

b84833b4c   Shrikant Sharat   Add readme.
80
81
  The usage should be very familiar to you if you use Vundle. A typical `.zshrc`
  might look like this
3c698aac0   Shrikant Sharat   Add information o...
82
      source /path-to-antigen-clone/antigen.zsh
b84833b4c   Shrikant Sharat   Add readme.
83
84
  
      # Load the oh-my-zsh's library.
de8d00ed4   Shrikant Sharat   Use the new comma...
85
      antigen-lib
b84833b4c   Shrikant Sharat   Add readme.
86
87
  
      # Bundles from the default repo (robbyrussell's oh-my-zsh).
de8d00ed4   Shrikant Sharat   Use the new comma...
88
89
90
91
92
      antigen-bundle git
      antigen-bundle heroku
      antigen-bundle pip
      antigen-bundle lein
      antigen-bundle command-not-found
b84833b4c   Shrikant Sharat   Add readme.
93
94
  
      # Syntax highlighting bundle.
de8d00ed4   Shrikant Sharat   Use the new comma...
95
      antigen-bundle zsh-users/zsh-syntax-highlighting
b84833b4c   Shrikant Sharat   Add readme.
96
97
  
      # Load the theme.
de8d00ed4   Shrikant Sharat   Use the new comma...
98
      antigen-theme robbyrussell
b84833b4c   Shrikant Sharat   Add readme.
99

1af74ea9e   Shrikant Sharat   Load completions ...
100
      # Tell antigen that you're done.
de8d00ed4   Shrikant Sharat   Use the new comma...
101
      antigen-apply
1af74ea9e   Shrikant Sharat   Load completions ...
102

7ba3548fd   Shrikant Sharat   Updated README wi...
103
104
  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
de8d00ed4   Shrikant Sharat   Use the new comma...
105
  syntax for the `antigen-bundle` command is discussed further down on this page.
b84833b4c   Shrikant Sharat   Add readme.
106

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
107
  ## Motivation
b84833b4c   Shrikant Sharat   Add readme.
108
109
  
  If you use zsh and [oh-my-zsh][], you know that having many different plugins
63088f869   Shrikant Sharat   Proof read README.
110
  that are developed by many different authors in a single (sub)repo is not very
b84833b4c   Shrikant Sharat   Add readme.
111
112
  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   Shrikant Sharat   Updated README wi...
113
  admire robbyrussell's efforts for reviewing and merging the gigantic number of
63088f869   Shrikant Sharat   Proof read README.
114
  pull requests the project gets. We need a better way of plugin management.
b84833b4c   Shrikant Sharat   Add readme.
115
116
117
118
119
120
121
122
123
124
125
126
127
  
  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   Shrikant Sharat   Proof read README.
128
129
130
  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   Shrikant Sharat   Add readme.
131
132
133
134
  
  Antigen also lets you switch the prompt theme with one command, just like that
  
      bundle-theme candy
63088f869   Shrikant Sharat   Proof read README.
135
136
  and your prompt is changed, just for this session of course (unless you put this
  line in your `.zshrc`).
b84833b4c   Shrikant Sharat   Add readme.
137

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
138
  ## Commands
b84833b4c   Shrikant Sharat   Add readme.
139

4a1cecfff   Shrikant Sharat   Add notes about a...
140
  The following are the commands provided by antigen. Note that the `-` in the
63088f869   Shrikant Sharat   Proof read README.
141
142
143
  following commands can be replaced with a space. You can write `antigen-bundle
  ...` as `antigen bundle ...` and get away with it. For more details see the help
  on `antigen` command further down in this section.
4a1cecfff   Shrikant Sharat   Add notes about a...
144

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
145
  ### antigen-bundle
b84833b4c   Shrikant Sharat   Add readme.
146

7ba3548fd   Shrikant Sharat   Updated README wi...
147
148
  This command tells antigen to install (if not already installed) and load the
  given plugin. The simplest usage follows the following syntax.
b84833b4c   Shrikant Sharat   Add readme.
149

2fe4683b3   Shrikant Sharat   Update README wit...
150
      antigen-bundle <plugin-name>
7e0aca7ce   Shrikant Sharat   Add notes about b...
151

63088f869   Shrikant Sharat   Proof read README.
152
  This will install and load the `plugins/<name>` directory from [robbyrussell's
7e0aca7ce   Shrikant Sharat   Add notes about b...
153
  oh-my-zsh][oh-my-zsh] (can be changed by setting `ANTIGEN_DEFAULT_REPO_URL`).
2fe4683b3   Shrikant Sharat   Update README wit...
154
155
  However, the above is just syntax sugar for the extended syntax of the
  `antigen-bundle` command.
7e0aca7ce   Shrikant Sharat   Add notes about b...
156

2fe4683b3   Shrikant Sharat   Update README wit...
157
      antigen-bundle [<url> [<loc>]]
b84833b4c   Shrikant Sharat   Add readme.
158
159
  
  where `<url>` is the repository url and it defaults to [robbyrussell's
7ba3548fd   Shrikant Sharat   Updated README wi...
160
161
162
163
164
  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   Shrikant Sharat   Add readme.
165
166
  
  An example invocation would be
2fe4683b3   Shrikant Sharat   Update README wit...
167
168
169
      # The following is the same as `antigen-bundle ant`. But for demonstration
      # purposes, we use the extended syntax here.
      antigen-bundle https://github.com/robbyrussell/oh-my-zsh.git plugins/ant
b84833b4c   Shrikant Sharat   Add readme.
170

7ba3548fd   Shrikant Sharat   Updated README wi...
171
172
  This would install the ant plugin from robbyrussell's oh-my-zsh repo. Of course,
  github url's can be shortened.
b84833b4c   Shrikant Sharat   Add readme.
173

2fe4683b3   Shrikant Sharat   Update README wit...
174
      antigen-bundle robbyrussell/oh-my-zsh plugins/ant
b84833b4c   Shrikant Sharat   Add readme.
175

7ba3548fd   Shrikant Sharat   Updated README wi...
176
177
  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   Shrikant Sharat   Add readme.
178

2fe4683b3   Shrikant Sharat   Update README wit...
179
180
  For this and a few other reasons, `antigen-bundle` also supports a simple
  keyword argument syntax, using which we can rewrite the above as
b84833b4c   Shrikant Sharat   Add readme.
181

2fe4683b3   Shrikant Sharat   Update README wit...
182
      antigen-bundle --loc=plugins/ant
b84833b4c   Shrikant Sharat   Add readme.
183

7ba3548fd   Shrikant Sharat   Updated README wi...
184
185
  Which picks up the default for the `url` argument, and uses the `loc` given to
  it.
7e0aca7ce   Shrikant Sharat   Add notes about b...
186

7ba3548fd   Shrikant Sharat   Updated README wi...
187
188
  *Note* that you can mix and match positional and keyword arguments. But you
  can't have positional arguments after keyword arguments.
b84833b4c   Shrikant Sharat   Add readme.
189

2fe4683b3   Shrikant Sharat   Update README wit...
190
      antigen-bundle robbyrussell/oh-my-zsh --loc=plugins/ant
b84833b4c   Shrikant Sharat   Add readme.
191
192
193
  
  And keyword arguments don't care about the order in which the arguments are
  specified. The following is perfectly valid.
2fe4683b3   Shrikant Sharat   Update README wit...
194
      antigen-bundle --loc=plugins/ant --url=robbyrussell/oh-my-zsh
5e26a8e26   Shrikant Sharat   Docs on using inl...
195

e97773908   Shrikant Sharat   Added docs on usi...
196
197
198
199
  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   Shrikant Sharat   Fix local paths w...
200
  refer to the notes on `--no-local-clone` below.
e97773908   Shrikant Sharat   Added docs on usi...
201

63088f869   Shrikant Sharat   Proof read README.
202
203
204
  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   Shrikant Sharat   Docs on using inl...
205

4129490ce   Shrikant Sharat   Add --branch note...
206
  Other keyword-only arguments accepted:
8a80d2b7a   Shrikant Sharat   Add docs on --no-...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
  `--branch={git-branch-name}` &mdash; Specify the branch of the git repo to be
  used for this bundle (without the braces of course). The default is whatever
  branch the clone comes with, which is usually `master`. For example,
  
      antigen-bundle github-user/repo --branch=develop
  
  This will get the plugin as in the branch `develop`.
  
  Note that if you specify two plugins to be loaded from the same git repo, but
  different branches, then two separate clones of this repo will be maintained.
  This is a small implementation detail and shouldn't influence you in any way.
  
  `--no-local-clone` &mdash; 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,
  
      antigen-bundle /absolute/path/to/the/plugin --no-local-clone
e6cc15b5f   Shrikant Sharat   Fix local paths w...
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   Shrikant Sharat   Add --branch note...
231

e97773908   Shrikant Sharat   Added docs on usi...
232
233
234
235
236
237
  Also, if the local path given as the url is not a git repo, then this
  argument is forced as it doesn't makes sense to *clone* something that's not a
  git repo. This property can be used to load any utility scripts you have in your
  dotfiles repo. For example,
  
      antigen-bundle $HOME/dotfiles/oh-my-zsh/custom
63088f869   Shrikant Sharat   Proof read README.
238
239
240
241
  In addition to the above discussed arguments, `antigen-bundle` also takes a
  `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.
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
242
  ### antigen-bundles
78ea5a9f4   Shrikant Sharat   Add notes on anti...
243
244
245
246
247
248
249
250
251
  
  If you have a fair number of bundles, using the `antigen-bundle` command can
  look cumbersome. You can use the `antigen-bundles` command to *bulk* define
  bundles instead of individual calls to `antigen-bundle`.
  
  Usage is pretty straightforward. Just pipe the bundle specifications, just as
  you would give to the `antigen-bundle` command, one per line, into the
  `antigen-bundles` command. The easiest way to do this, is using the heredoc
  syntax.
63088f869   Shrikant Sharat   Proof read README.
252
      antigen-bundles <<EOBUNDLES
78ea5a9f4   Shrikant Sharat   Add notes on anti...
253
254
255
256
257
      # Guess what to install when running an unknown command.
      command-not-found
  
      # The heroku tool helper plugin.
      heroku
63088f869   Shrikant Sharat   Proof read README.
258
      EOBUNDLES
78ea5a9f4   Shrikant Sharat   Add notes on anti...
259
260
261
262
263
264
265
266
267
268
269
  
  This is equivalent to
  
      antigen-bundle command-not-found
      antigen-bundle heroku
  
  Of course, as you can see, from the lines piped to `antigen-bundles`, empty
  lines and those starting with a `#` are ignored. The rest are passed to
  `antigen-bundle` without any quoting rules applied. They are actually `eval`-ed
  with the `antigen-bundle` command. See the source if you want to really
  understand how it works. Its a very small function.
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
270
  ### antigen-update
5e26a8e26   Shrikant Sharat   Docs on using inl...
271

7ba3548fd   Shrikant Sharat   Updated README wi...
272
273
  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   Shrikant Sharat   Docs on using inl...
274

2fe4683b3   Shrikant Sharat   Update README wit...
275
      antigen-update
5e26a8e26   Shrikant Sharat   Docs on using inl...
276

7ba3548fd   Shrikant Sharat   Updated README wi...
277
278
279
280
281
  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   Shrikant Sharat   Add readme.
282

2fe4683b3   Shrikant Sharat   Update README wit...
283
284
  **Please note**: This command is not for updating *antigen* itself. Its for
  updating the bundles you are using with antigen.
8cf9a21d1   Shrikant Sharat   Add docs about -r...
285
286
287
288
289
290
291
292
293
294
  ### antigen-revert <sup>&alpha;</sup>
  
  Reverts the state of all your plugins to how they were before the last
  `antigen-update`. This command is currently experimental, so don't rely too much
  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.
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
295
  ### antigen-list
de2f0c562   Shrikant Sharat   Add a note in REA...
296

7ba3548fd   Shrikant Sharat   Updated README wi...
297
298
  Use this command to list out the currently *loaded* plugins. Keep in mind that
  this includes any bundles installed on-the-fly.
de2f0c562   Shrikant Sharat   Add a note in REA...
299

63088f869   Shrikant Sharat   Proof read README.
300
301
302
303
304
305
306
307
308
309
  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   Shrikant Sharat   Add a note in REA...
310

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
311
  ### antigen-cleanup
b84833b4c   Shrikant Sharat   Add readme.
312

63088f869   Shrikant Sharat   Proof read README.
313
314
315
  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   Shrikant Sharat   Add readme.
316

7f742ef26   Shrikant Sharat   Add docs on `--fo...
317
318
319
320
  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   Shrikant Sharat   Add readme.
321

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
322
  ### antigen-lib
b84833b4c   Shrikant Sharat   Add readme.
323

7ba3548fd   Shrikant Sharat   Updated README wi...
324
  This is a shortcut to
2fe4683b3   Shrikant Sharat   Update README wit...
325
      antigen-bundle --loc=lib
7ba3548fd   Shrikant Sharat   Updated README wi...
326

63088f869   Shrikant Sharat   Proof read README.
327
328
329
330
331
332
  So, it basically installs the oh-my-zsh's library as a bundle.
  
  Please note that this assumes that the `ANTIGEN_DEFAULT_REPO_URL` is set to the
  oh-my-zsh repo or a fork of that repo. If you want to specify the `url` too,
  then you can't use the `antigen-lib` short cut. You have to do that directly
  with the `antigen-bundle` command.
7ba3548fd   Shrikant Sharat   Updated README wi...
333
334
335
336
337
  
  This is present only for legacy reasons and *might* (or might not) be removed in
  the future.
  
  Use
b84833b4c   Shrikant Sharat   Add readme.
338

2fe4683b3   Shrikant Sharat   Update README wit...
339
      antigen-lib
b84833b4c   Shrikant Sharat   Add readme.
340

2fe4683b3   Shrikant Sharat   Update README wit...
341
342
  in  your `.zshrc`, before any `antigen-bundle` declarations. It takes no
  arguments.
b84833b4c   Shrikant Sharat   Add readme.
343

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
344
  ### antigen-theme
b84833b4c   Shrikant Sharat   Add readme.
345
346
347
  
  Used for switching the prompt theme. Invoke it with the name of the theme you
  want to use.
2fe4683b3   Shrikant Sharat   Update README wit...
348
      antigen-theme fox
b84833b4c   Shrikant Sharat   Add readme.
349
350
351
  
  Currently, themes are pulled from robbyrussell's oh-my-zsh repo, but it will
  support getting themes from other repos as well in the future.
7ba3548fd   Shrikant Sharat   Updated README wi...
352
353
  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`.
63088f869   Shrikant Sharat   Proof read README.
354
355
356
  **Note**: Some themes use functions that are loaded by `antigen-lib`. So, to
  avoid any trouble, run `antigen-lib` if you haven't already before experimenting
  with themes. If you have `antigen-lib` in your `.zshrc`, you're covered.
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
357
  ### antigen-apply
1af74ea9e   Shrikant Sharat   Load completions ...
358
359
360
361
362
363
  
  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   Shrikant Sharat   Proof read README.
364
365
366
  the completions is a time-consuming process, so if the completions were loaded
  at every call to `antigen-bundle`, your shell will start noticeably slow when
  you have a good number of bundle specifications.
1af74ea9e   Shrikant Sharat   Load completions ...
367

63088f869   Shrikant Sharat   Proof read README.
368
369
  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   Shrikant Sharat   Load completions ...
370

4a1cecfff   Shrikant Sharat   Add notes about a...
371
372
373
374
375
376
377
378
379
380
381
  ### antigen-help
  
  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.
  
  ### antigen
63088f869   Shrikant Sharat   Proof read README.
382
383
  This is a parent command that mainly exists for convenience. This exists so the
  following two can be the same.
4a1cecfff   Shrikant Sharat   Add notes about a...
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
  
      antigen-list
      antigen list
  
  and
  
      antigen-help
      antigen help
  
  Because of this, we can create aliases like
  
      alias a=antigen
      alias an=antigen
  
  and run the antigen commands without making them look annoyingly long.
  
      a bundle ruby
      a theme candy
      a list
  
  And even...
  
      an update
ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
407
  ## Configuration
b84833b4c   Shrikant Sharat   Add readme.
408
409
  
  The following environment variables can be set to customize the behavior of
7ba3548fd   Shrikant Sharat   Updated README wi...
410
  antigen. Make sure you set them *before* source-ing `antigen.zsh`.
b84833b4c   Shrikant Sharat   Add readme.
411
412
413
414
  
  `ANTIGEN_DEFAULT_REPO_URL` &mdash; 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   Shrikant Sharat   Use ADOTDIR as th...
415
416
417
  `ADOTDIR` &mdash; 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   Shrikant Sharat   Add readme.
418

911cc8cb5   Shrikant Sharat   Use ADOTDIR as th...
419
420
421
  **Note**: `ANTIGEN_REPO_CACHE` & `ANTIGEN_BUNDLE_DIR` &mdash; These variables
  were used previously but are now removed. Please use `ADOTDIR` instead, as
  mentioned above.
b84833b4c   Shrikant Sharat   Add readme.
422

72e36b84e   Shrikant Sharat   Notes on running ...
423
  ## Running the tests
79953f965   Shrikant Sharat   Fix readme links....
424
  All the tests are in the `tests` folder and are run using the [cram][] test
dbbcf97bc   Shrikant Sharat   Add notes on inst...
425
426
427
  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   Shrikant Sharat   Notes on running ...
428

dbbcf97bc   Shrikant Sharat   Add notes on inst...
429
      pip install -r requirements.txt
72e36b84e   Shrikant Sharat   Notes on running ...
430

dbbcf97bc   Shrikant Sharat   Add notes on inst...
431
  With that, once you have cram installed, you can run the tests as
72e36b84e   Shrikant Sharat   Notes on running ...
432

dbbcf97bc   Shrikant Sharat   Add notes on inst...
433
      make
72e36b84e   Shrikant Sharat   Notes on running ...
434
435
436
437
438
  
  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   Shrikant Sharat   Heading levels + 1.
439
  ## Notes on writing plugins
b36de9bb3   Shrikant Sharat   Add links in READ...
440

b33b9e9d4   Shrikant Sharat   Fix #24. Add reco...
441
442
443
444
445
446
447
  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   Shrikant Sharat   Notes on writing ...
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
  
  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
  present, it will source *only* this script. Nothing else is sourced.
  
  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   Shrikant Sharat   Proof read README.
464
465
466
467
468
  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   Shrikant Sharat   Add links in READ...
469

ac6ddd7d4   Shrikant Sharat   Heading levels + 1.
470
  ## Meta
b84833b4c   Shrikant Sharat   Add readme.
471

72e36b84e   Shrikant Sharat   Notes on running ...
472
473
474
  ### Helping out
  
  Antigen is licensed with the [MIT License][license]. To contribute, just fork,
7ba3548fd   Shrikant Sharat   Updated README wi...
475
476
  make changes and send a pull request. If its a rather long/complicated change,
  please consider opening an [issue][] first so we can discuss it out.
b84833b4c   Shrikant Sharat   Add readme.
477

72e36b84e   Shrikant Sharat   Notes on running ...
478
  ### Feedback please
f76ba3b6c   Shrikant Sharat   Removed link to r...
479
480
481
  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   Shrikant Sharat   Add link to proje...
482

b84833b4c   Shrikant Sharat   Add readme.
483
  [Vundle]: https://github.com/gmarik/vundle
b36de9bb3   Shrikant Sharat   Add links in READ...
484
485
  [page on themes]: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
  [syntax highlighting plugin]: https://github.com/zsh-users/zsh-syntax-highlighting
3e16c4709   Shrikant Sharat   Add autoenv as an...
486
  [autoenv]: https://github.com/kennethreitz/autoenv
b84833b4c   Shrikant Sharat   Add readme.
487
  [oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh
72e36b84e   Shrikant Sharat   Notes on running ...
488
  [cram]: https://bitheap.org/cram/
290edb005   Shrikant Sharat   Fix link to githu...
489
  [issue]: https://github.com/zsh-users/antigen/issues
7ba3548fd   Shrikant Sharat   Updated README wi...
490
  [license]: http://mit.sharats.me
7ba3548fd   Shrikant Sharat   Updated README wi...
491
  [twitter]: http://twitter.com/sharat87