Commit 753dfe3f2a5ae50abed7ad7886bbcbe0a27120a1
1 parent
d91610f469
Antigen v1 :sparkles:.
Showing 1 changed file with 3 additions and 3 deletions Inline Diff
README.mkd
| 1 | # Antigen <sup>β</sup> | 1 | # Antigen <sup>v1</sup> |
| 2 | 2 | ||
| 3 | [](http://travis-ci.org/zsh-users/antigen) | 3 | [](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 | Antigen has reached a certain level of stability and has been used in the wild |
| 10 | That said, I am using antigen full time now on my work machine. | 10 | for around a couple of years. If you face any problems, please open an issue. |
| 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](#antigen-theme). | 75 | `antigen theme` command further down](#antigen-theme). |
| 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 | ### antigen bundle | 159 | ### antigen bundle |
| 160 | 160 | ||
| 161 | 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 |
| 162 | given plugin. The simplest usage follows the following syntax. | 162 | given plugin. The simplest usage follows the following syntax. |
| 163 | 163 | ||
| 164 | antigen bundle <plugin-name> | 164 | antigen bundle <plugin-name> |
| 165 | 165 | ||
| 166 | 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 |
| 167 | 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`). |
| 168 | 168 | ||
| 169 | 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 |
| 170 | `antigen bundle` command. | 170 | `antigen bundle` command. |
| 171 | 171 | ||
| 172 | antigen bundle [<url> [<loc>]] | 172 | antigen bundle [<url> [<loc>]] |
| 173 | 173 | ||
| 174 | 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 |
| 175 | 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` |
| 176 | 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 |
| 177 | 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, |
| 178 | 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. |
| 179 | `<loc>` defaults to `/`, which indicates the repository itself is a plugin. | 179 | `<loc>` defaults to `/`, which indicates the repository itself is a plugin. |
| 180 | 180 | ||
| 181 | An example invocation would be | 181 | An example invocation would be |
| 182 | 182 | ||
| 183 | # 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 |
| 184 | # purposes, we use the extended syntax here. | 184 | # purposes, we use the extended syntax here. |
| 185 | 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 |
| 186 | 186 | ||
| 187 | 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, |
| 188 | github url's can be shortened. | 188 | github url's can be shortened. |
| 189 | 189 | ||
| 190 | antigen bundle robbyrussell/oh-my-zsh plugins/ant | 190 | antigen bundle robbyrussell/oh-my-zsh plugins/ant |
| 191 | 191 | ||
| 192 | 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 |
| 193 | specify the `loc` without giving the first argument. | 193 | specify the `loc` without giving the first argument. |
| 194 | 194 | ||
| 195 | 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 |
| 196 | keyword argument syntax, using which we can rewrite the above as | 196 | keyword argument syntax, using which we can rewrite the above as |
| 197 | 197 | ||
| 198 | antigen bundle --loc=plugins/ant | 198 | antigen bundle --loc=plugins/ant |
| 199 | 199 | ||
| 200 | 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 |
| 201 | it. | 201 | it. |
| 202 | 202 | ||
| 203 | *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 |
| 204 | can't have positional arguments after keyword arguments. | 204 | can't have positional arguments after keyword arguments. |
| 205 | 205 | ||
| 206 | antigen bundle robbyrussell/oh-my-zsh --loc=plugins/ant | 206 | antigen bundle robbyrussell/oh-my-zsh --loc=plugins/ant |
| 207 | 207 | ||
| 208 | 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 |
| 209 | specified. The following is perfectly valid. | 209 | specified. The following is perfectly valid. |
| 210 | 210 | ||
| 211 | antigen bundle --loc=plugins/ant --url=robbyrussell/oh-my-zsh | 211 | antigen bundle --loc=plugins/ant --url=robbyrussell/oh-my-zsh |
| 212 | 212 | ||
| 213 | 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 |
| 214 | 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 |
| 215 | `/`). 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 |
| 216 | 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 |
| 217 | refer to the notes on `--no-local-clone` below. | 217 | refer to the notes on `--no-local-clone` below. |
| 218 | 218 | ||
| 219 | 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 |
| 220 | 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 |
| 221 | 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`. |
| 222 | 222 | ||
| 223 | Other keyword-only arguments accepted: | 223 | Other keyword-only arguments accepted: |
| 224 | 224 | ||
| 225 | `--branch={git-branch-name}` — Specify the branch of the git repo to be | 225 | `--branch={git-branch-name}` — Specify the branch of the git repo to be |
| 226 | 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 |
| 227 | branch the clone comes with, which is usually `master`. For example, | 227 | branch the clone comes with, which is usually `master`. For example, |
| 228 | 228 | ||
| 229 | antigen bundle github-user/repo --branch=develop | 229 | antigen bundle github-user/repo --branch=develop |
| 230 | 230 | ||
| 231 | This will get the plugin as in the branch `develop`. | 231 | This will get the plugin as in the branch `develop`. |
| 232 | 232 | ||
| 233 | 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 |
| 234 | 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. |
| 235 | 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. |
| 236 | 236 | ||
| 237 | `--no-local-clone` — This command can be useful if you are developing a | 237 | `--no-local-clone` — This command can be useful if you are developing a |
| 238 | 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 |
| 239 | 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 |
| 240 | `$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 |
| 241 | 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 |
| 242 | creating a clone. For example, | 242 | creating a clone. For example, |
| 243 | 243 | ||
| 244 | antigen bundle /absolute/path/to/the/plugin --no-local-clone | 244 | antigen bundle /absolute/path/to/the/plugin --no-local-clone |
| 245 | 245 | ||
| 246 | 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 |
| 247 | 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, |
| 248 | 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 |
| 249 | and no `--branch` should be specified. | 249 | and no `--branch` should be specified. |
| 250 | 250 | ||
| 251 | 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 |
| 252 | 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 |
| 253 | 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 |
| 254 | dotfiles repo. For example, | 254 | dotfiles repo. For example, |
| 255 | 255 | ||
| 256 | antigen bundle $HOME/dotfiles/oh-my-zsh/custom | 256 | antigen bundle $HOME/dotfiles/oh-my-zsh/custom |
| 257 | 257 | ||
| 258 | 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 |
| 259 | `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 |
| 260 | 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 |
| 261 | 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. |
| 262 | 262 | ||
| 263 | ### antigen bundles | 263 | ### antigen bundles |
| 264 | 264 | ||
| 265 | 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 |
| 266 | 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 |
| 267 | bundles instead of individual calls to `antigen bundle`. | 267 | bundles instead of individual calls to `antigen bundle`. |
| 268 | 268 | ||
| 269 | Usage is pretty straightforward. Just pipe the bundle specifications, just as | 269 | Usage is pretty straightforward. Just pipe the bundle specifications, just as |
| 270 | 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 |
| 271 | `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 |
| 272 | syntax. | 272 | syntax. |
| 273 | 273 | ||
| 274 | antigen bundles <<EOBUNDLES | 274 | antigen bundles <<EOBUNDLES |
| 275 | # Guess what to install when running an unknown command. | 275 | # Guess what to install when running an unknown command. |
| 276 | command-not-found | 276 | command-not-found |
| 277 | 277 | ||
| 278 | # The heroku tool helper plugin. | 278 | # The heroku tool helper plugin. |
| 279 | heroku | 279 | heroku |
| 280 | EOBUNDLES | 280 | EOBUNDLES |
| 281 | 281 | ||
| 282 | This is equivalent to | 282 | This is equivalent to |
| 283 | 283 | ||
| 284 | antigen bundle command-not-found | 284 | antigen bundle command-not-found |
| 285 | antigen bundle heroku | 285 | antigen bundle heroku |
| 286 | 286 | ||
| 287 | 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 |
| 288 | 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 |
| 289 | `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 |
| 290 | 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 |
| 291 | understand how it works. Its a very small function. | 291 | understand how it works. Its a very small function. |
| 292 | 292 | ||
| 293 | *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 |
| 294 | antigen-bundles to work. Its allowed (and encouraged) to improve readability. | 294 | antigen-bundles to work. Its allowed (and encouraged) to improve readability. |
| 295 | 295 | ||
| 296 | ### antigen update | 296 | ### antigen update |
| 297 | 297 | ||
| 298 | 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 |
| 299 | 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. |
| 300 | 300 | ||
| 301 | antigen update | 301 | antigen update |
| 302 | 302 | ||
| 303 | 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. |
| 304 | 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 |
| 305 | 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 |
| 306 | 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 |
| 307 | real quirky. | 307 | real quirky. |
| 308 | 308 | ||
| 309 | **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 |
| 310 | 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, |
| 311 | use the `selfupdate` command described further below. | 311 | use the `selfupdate` command described further below. |
| 312 | 312 | ||
| 313 | ### antigen revert <sup>α</sup> | 313 | ### antigen revert <sup>α</sup> |
| 314 | 314 | ||
| 315 | 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 |
| 316 | `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 |
| 317 | 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. |
| 318 | 318 | ||
| 319 | Takes no options. | 319 | Takes no options. |
| 320 | 320 | ||
| 321 | Insider detail: The information for reverting is stored in | 321 | Insider detail: The information for reverting is stored in |
| 322 | `$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. |
| 323 | 323 | ||
| 324 | ### antigen list | 324 | ### antigen list |
| 325 | 325 | ||
| 326 | 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 |
| 327 | this includes any bundles installed on-the-fly. | 327 | this includes any bundles installed on-the-fly. |
| 328 | 328 | ||
| 329 | 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 |
| 330 | following fields of each bundle. | 330 | following fields of each bundle. |
| 331 | 331 | ||
| 332 | <repo-url> <loc> <btype> <has-local-clone?> | 332 | <repo-url> <loc> <btype> <has-local-clone?> |
| 333 | 333 | ||
| 334 | 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 |
| 335 | `plugin` or a `theme`. | 335 | `plugin` or a `theme`. |
| 336 | 336 | ||
| 337 | 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 |
| 338 | for this bundle. | 338 | for this bundle. |
| 339 | 339 | ||
| 340 | ### antigen cleanup | 340 | ### antigen cleanup |
| 341 | 341 | ||
| 342 | 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 |
| 343 | 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 |
| 344 | available but are not used by any plugin *currently loaded*. | 344 | available but are not used by any plugin *currently loaded*. |
| 345 | 345 | ||
| 346 | This command, by default asks for confirmation before deleting the unused | 346 | This command, by default asks for confirmation before deleting the unused |
| 347 | 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. |
| 348 | 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 |
| 349 | usable in a non-interactive fashion. | 349 | usable in a non-interactive fashion. |
| 350 | 350 | ||
| 351 | ### antigen use | 351 | ### antigen use |
| 352 | 352 | ||
| 353 | This command lets you load any (supported) zsh pre-packaged framework, like | 353 | This command lets you load any (supported) zsh pre-packaged framework, like |
| 354 | oh-my-zsh. Usage is | 354 | oh-my-zsh. Usage is |
| 355 | 355 | ||
| 356 | antigen use oh-my-zsh | 356 | antigen use oh-my-zsh |
| 357 | 357 | ||
| 358 | Additional arguments may be present depending on the framework you are | 358 | Additional arguments may be present depending on the framework you are |
| 359 | `use`-ing. Here are the supported frameworks. | 359 | `use`-ing. Here are the supported frameworks. |
| 360 | 360 | ||
| 361 | #### oh-my-zsh | 361 | #### oh-my-zsh |
| 362 | 362 | ||
| 363 | This is (almost) the same as | 363 | This is (almost) the same as |
| 364 | 364 | ||
| 365 | antigen bundle --loc=lib | 365 | antigen bundle --loc=lib |
| 366 | 366 | ||
| 367 | So, it basically installs the oh-my-zsh's library as a bundle. | 367 | So, it basically installs the oh-my-zsh's library as a bundle. |
| 368 | 368 | ||
| 369 | One other thing it does is that some oh-my-zsh plugins expect a `$ZSH` set to | 369 | One other thing it does is that some oh-my-zsh plugins expect a `$ZSH` set to |
| 370 | the full path of the oh-my-zsh clone being used. This is also set to the | 370 | the full path of the oh-my-zsh clone being used. This is also set to the |
| 371 | correct path, if not already set to something else. | 371 | correct path, if not already set to something else. |
| 372 | 372 | ||
| 373 | Please note that this assumes that the `ANTIGEN_DEFAULT_REPO_URL` is set to the | 373 | Please note that this assumes that the `ANTIGEN_DEFAULT_REPO_URL` is set to the |
| 374 | oh-my-zsh repo or a fork of that repo. If you want to specify the `url` too, | 374 | oh-my-zsh repo or a fork of that repo. If you want to specify the `url` too, |
| 375 | then you can't use the `antigen use oh-my-zsh` short cut. You have to do that | 375 | then you can't use the `antigen use oh-my-zsh` short cut. You have to do that |
| 376 | directly with the `antigen bundle` command. | 376 | directly with the `antigen bundle` command. |
| 377 | 377 | ||
| 378 | Use | 378 | Use |
| 379 | 379 | ||
| 380 | antigen use oh-my-zsh | 380 | antigen use oh-my-zsh |
| 381 | 381 | ||
| 382 | in your `.zshrc`, before any `antigen bundle` declarations. It takes no further | 382 | in your `.zshrc`, before any `antigen bundle` declarations. It takes no further |
| 383 | arguments. | 383 | arguments. |
| 384 | 384 | ||
| 385 | #### prezto | 385 | #### prezto |
| 386 | 386 | ||
| 387 | This is (almost, but not quite) the same as doing, | 387 | This is (almost, but not quite) the same as doing, |
| 388 | 388 | ||
| 389 | antigen bundle sorin-ionescu/prezto | 389 | antigen bundle sorin-ionescu/prezto |
| 390 | 390 | ||
| 391 | That is, initializes the canonical repo of the prezto framework. Please note | 391 | That is, initializes the canonical repo of the prezto framework. Please note |
| 392 | that prezto support is very new and experimental in antigen. If you find any | 392 | that prezto support is very new and experimental in antigen. If you find any |
| 393 | bugs, please report over on github issues. | 393 | bugs, please report over on github issues. |
| 394 | 394 | ||
| 395 | Takes no further arguments. | 395 | Takes no further arguments. |
| 396 | 396 | ||
| 397 | ### antigen theme | 397 | ### antigen theme |
| 398 | 398 | ||
| 399 | Used for switching the prompt theme. Invoke it with the name of the theme you | 399 | Used for switching the prompt theme. Invoke it with the name of the theme you |
| 400 | want to use. | 400 | want to use. |
| 401 | 401 | ||
| 402 | antigen theme fox | 402 | antigen theme fox |
| 403 | 403 | ||
| 404 | This will get the theme file located at `themes/fox.zsh-theme` in the repo | 404 | This will get the theme file located at `themes/fox.zsh-theme` in the repo |
| 405 | specified by `ANTIGEN_DEFAULT_REPO_URL`. | 405 | specified by `ANTIGEN_DEFAULT_REPO_URL`. |
| 406 | 406 | ||
| 407 | To pull themes from other repositories, use `antigen theme` just like | 407 | To pull themes from other repositories, use `antigen theme` just like |
| 408 | `antigen bundle`. Exactly the same, just make sure the `url` and `loc` | 408 | `antigen bundle`. Exactly the same, just make sure the `url` and `loc` |
| 409 | combination point to a theme file, having a `.zsh-theme` extension. | 409 | combination point to a theme file, having a `.zsh-theme` extension. |
| 410 | 410 | ||
| 411 | For example, | 411 | For example, |
| 412 | 412 | ||
| 413 | antigen theme robbyrussell/oh-my-zsh themes/apple | 413 | antigen theme robbyrussell/oh-my-zsh themes/apple |
| 414 | 414 | ||
| 415 | Will pull the apple theme from the canonical oh-my-zsh repo. Also, note that the | 415 | Will pull the apple theme from the canonical oh-my-zsh repo. Also, note that the |
| 416 | `.zsh-theme` extension is not present. It can be given, its optional. | 416 | `.zsh-theme` extension is not present. It can be given, its optional. |
| 417 | 417 | ||
| 418 | To get themes from arbitrary git repos (such as gists) use, | 418 | To get themes from arbitrary git repos (such as gists) use, |
| 419 | 419 | ||
| 420 | antigen theme https://gist.github.com/3750104.git agnoster | 420 | antigen theme https://gist.github.com/3750104.git agnoster |
| 421 | 421 | ||
| 422 | in which case there is a file called `agnoster.zsh-theme` present in the gist at | 422 | in which case there is a file called `agnoster.zsh-theme` present in the gist at |
| 423 | https://gist.github.com/3750104. | 423 | https://gist.github.com/3750104. |
| 424 | 424 | ||
| 425 | You can use this command to change your theme on the fly in your shell. Go on, | 425 | You can use this command to change your theme on the fly in your shell. Go on, |
| 426 | try out a few themes in your shell before you set it in your `.zshrc`. | 426 | try out a few themes in your shell before you set it in your `.zshrc`. |
| 427 | 427 | ||
| 428 | **Note**: Some themes use functions that are loaded by `antigen use oh-my-zsh`. | 428 | **Note**: Some themes use functions that are loaded by `antigen use oh-my-zsh`. |
| 429 | So, to avoid any trouble, run `antigen use oh-my-zsh` if you haven't already | 429 | So, to avoid any trouble, run `antigen use oh-my-zsh` if you haven't already |
| 430 | before experimenting with themes. If you have `antigen use oh-my-zsh` in your | 430 | before experimenting with themes. If you have `antigen use oh-my-zsh` in your |
| 431 | `.zshrc`, you're covered. | 431 | `.zshrc`, you're covered. |
| 432 | 432 | ||
| 433 | **Note**: Do *not* provide the `--btype` argument to `antigen theme`. Its an | 433 | **Note**: Do *not* provide the `--btype` argument to `antigen theme`. Its an |
| 434 | internal argument. | 434 | internal argument. |
| 435 | 435 | ||
| 436 | *For the interested, you can read more details on the purpose & workings of the | 436 | *For the interested, you can read more details on the purpose & workings of the |
| 437 | `theme` command on the comments of issue #78.* | 437 | `theme` command on the comments of issue #78.* |
| 438 | 438 | ||
| 439 | ### antigen apply | 439 | ### antigen apply |
| 440 | 440 | ||
| 441 | You have to add this command after defining all bundles you need, in your zshrc. | 441 | You have to add this command after defining all bundles you need, in your zshrc. |
| 442 | The completions defined by your bundles will be loaded at this step. | 442 | The completions defined by your bundles will be loaded at this step. |
| 443 | 443 | ||
| 444 | It is possible to load completions as and when a bundle is specified with the | 444 | It is possible to load completions as and when a bundle is specified with the |
| 445 | bundle command, in which case this command would not be necessary. But loading | 445 | bundle command, in which case this command would not be necessary. But loading |
| 446 | the completions is a time-consuming process, so if the completions were loaded | 446 | the completions is a time-consuming process, so if the completions were loaded |
| 447 | at every call to `antigen bundle`, your shell will start noticeably slow when | 447 | at every call to `antigen bundle`, your shell will start noticeably slow when |
| 448 | you have a good number of bundle specifications. | 448 | you have a good number of bundle specifications. |
| 449 | 449 | ||
| 450 | However, if you can suggest a way so that this would not be necessary, I am very | 450 | However, if you can suggest a way so that this would not be necessary, I am very |
| 451 | interested in discussing it. Please open up an issue with your details. Thanks. | 451 | interested in discussing it. Please open up an issue with your details. Thanks. |
| 452 | 452 | ||
| 453 | ### antigen snapshot <sup>α</sup> | 453 | ### antigen snapshot <sup>α</sup> |
| 454 | 454 | ||
| 455 | Creates a snapshot of all the clones you currently have *active* including the | 455 | Creates a snapshot of all the clones you currently have *active* including the |
| 456 | git version hash they are at and save it to a snapshot file. *Active* means, the | 456 | git version hash they are at and save it to a snapshot file. *Active* means, the |
| 457 | clones for those listed by `antigen cleanup` are not included in the snapshot. | 457 | clones for those listed by `antigen cleanup` are not included in the snapshot. |
| 458 | 458 | ||
| 459 | Takes one optional argument, the file name in which the snapshot is to be saved. | 459 | Takes one optional argument, the file name in which the snapshot is to be saved. |
| 460 | Defaults to `antigen snapshot`. | 460 | Defaults to `antigen snapshot`. |
| 461 | 461 | ||
| 462 | **Note**: The snapshot currently *only* contains the details of those bundles | 462 | **Note**: The snapshot currently *only* contains the details of those bundles |
| 463 | that have a clone. That is, bundles that have `--no-local-clone` set or are | 463 | that have a clone. That is, bundles that have `--no-local-clone` set or are |
| 464 | directly sourced from your file system (without a git repo), are not recorded | 464 | directly sourced from your file system (without a git repo), are not recorded |
| 465 | in the snapshot file. | 465 | in the snapshot file. |
| 466 | 466 | ||
| 467 | ### antigen restore <sup>α</sup> | 467 | ### antigen restore <sup>α</sup> |
| 468 | 468 | ||
| 469 | Restore the bundles state as specified in the snapshot. Takes one required | 469 | Restore the bundles state as specified in the snapshot. Takes one required |
| 470 | argument, the snapshot file name to read. | 470 | argument, the snapshot file name to read. |
| 471 | 471 | ||
| 472 | Although it restores the clones of the repos specified in the snapshot file, any | 472 | Although it restores the clones of the repos specified in the snapshot file, any |
| 473 | other clones present in your environment are not touched. This behavior may | 473 | other clones present in your environment are not touched. This behavior may |
| 474 | change in the future. | 474 | change in the future. |
| 475 | 475 | ||
| 476 | ### antigen selfupdate | 476 | ### antigen selfupdate |
| 477 | 477 | ||
| 478 | Use this command to update your copy of antigen. It basically does a `git pull` | 478 | Use this command to update your copy of antigen. It basically does a `git pull` |
| 479 | on your antigen's clone, *if* it is a git clone. Otherwise, it doesn't do | 479 | on your antigen's clone, *if* it is a git clone. Otherwise, it doesn't do |
| 480 | anything. | 480 | anything. |
| 481 | 481 | ||
| 482 | Takes no options. | 482 | Takes no options. |
| 483 | 483 | ||
| 484 | ### antigen help | 484 | ### antigen help |
| 485 | 485 | ||
| 486 | This exists so that there can be some help right in the command line. Currently | 486 | This exists so that there can be some help right in the command line. Currently |
| 487 | it doesn't provide much help other than redirecting you to the project page for | 487 | it doesn't provide much help other than redirecting you to the project page for |
| 488 | documentation. It is intended to provide more meaning and sub-command specific | 488 | documentation. It is intended to provide more meaning and sub-command specific |
| 489 | help in the future. | 489 | help in the future. |
| 490 | 490 | ||
| 491 | I could use some help here as I'm not that good at writing documentation that | 491 | I could use some help here as I'm not that good at writing documentation that |
| 492 | looks good as output on the command line. | 492 | looks good as output on the command line. |
| 493 | 493 | ||
| 494 | ## Configuration | 494 | ## Configuration |
| 495 | 495 | ||
| 496 | The following environment variables can be set to customize the behavior of | 496 | The following environment variables can be set to customize the behavior of |
| 497 | antigen. Make sure you set them *before* source-ing `antigen.zsh`. | 497 | antigen. Make sure you set them *before* source-ing `antigen.zsh`. |
| 498 | 498 | ||
| 499 | `ANTIGEN_DEFAULT_REPO_URL` — This is the default repository url that is | 499 | `ANTIGEN_DEFAULT_REPO_URL` — This is the default repository url that is |
| 500 | used for `bundle` commands. The default value is robbyrussell's oh-my-zsh repo, | 500 | used for `bundle` commands. The default value is robbyrussell's oh-my-zsh repo, |
| 501 | but you can set this to the fork url of your own fork. | 501 | but you can set this to the fork url of your own fork. |
| 502 | 502 | ||
| 503 | `ADOTDIR` — This directory is used to store all the repo clones, your | 503 | `ADOTDIR` — This directory is used to store all the repo clones, your |
| 504 | bundles, themes, caches and everything else antigen requires to run smoothly. | 504 | bundles, themes, caches and everything else antigen requires to run smoothly. |
| 505 | Defaults to `$HOME/.antigen`. | 505 | Defaults to `$HOME/.antigen`. |
| 506 | 506 | ||
| 507 | **Note**: `ANTIGEN_REPO_CACHE` & `ANTIGEN_BUNDLE_DIR` — These variables | 507 | **Note**: `ANTIGEN_REPO_CACHE` & `ANTIGEN_BUNDLE_DIR` — These variables |
| 508 | were used previously but are now removed. Please use `ADOTDIR` instead, as | 508 | were used previously but are now removed. Please use `ADOTDIR` instead, as |
| 509 | mentioned above. | 509 | mentioned above. |
| 510 | 510 | ||
| 511 | ## Running the tests | 511 | ## Running the tests |
| 512 | 512 | ||
| 513 | All the tests are in the `tests` folder and are run using the [cram][] test | 513 | All the tests are in the `tests` folder and are run using the [cram][] test |
| 514 | system. The latest version on that website, as of today is v0.5, which does not | 514 | system. The latest version on that website, as of today is v0.5, which does not |
| 515 | have the `--shell` argument which is required to run our tests. So, to get the | 515 | have the `--shell` argument which is required to run our tests. So, to get the |
| 516 | correct version of cram, run | 516 | correct version of cram, run |
| 517 | 517 | ||
| 518 | pip install -r requirements.txt | 518 | pip install -r requirements.txt |
| 519 | 519 | ||
| 520 | With that, once you have cram installed, you can run the tests as | 520 | With that, once you have cram installed, you can run the tests as |
| 521 | 521 | ||
| 522 | make | 522 | make |
| 523 | 523 | ||
| 524 | If you are making a feature addition, I'd really appreciate if you can add a | 524 | If you are making a feature addition, I'd really appreciate if you can add a |
| 525 | test for your feature. Even if you can add a test for an existing feature, that | 525 | test for your feature. Even if you can add a test for an existing feature, that |
| 526 | would be great as the tests are currently seriously lagging behind the full | 526 | would be great as the tests are currently seriously lagging behind the full |
| 527 | functionality of antigen. | 527 | functionality of antigen. |
| 528 | 528 | ||
| 529 | ## Notes on writing plugins | 529 | ## Notes on writing plugins |
| 530 | 530 | ||
| 531 | Most shell utilities/plugins are made up of just one file. For a plugin called | 531 | Most shell utilities/plugins are made up of just one file. For a plugin called |
| 532 | `awesomeness`, create a `awesomeness.plugin.zsh` and code away. | 532 | `awesomeness`, create a `awesomeness.plugin.zsh` and code away. |
| 533 | 533 | ||
| 534 | That said, even if you write a single file as a `.sh` file with the goodness you | 534 | That said, even if you write a single file as a `.sh` file with the goodness you |
| 535 | want to create, antigen will work just fine with it. The `*.plugin.zsh` way is | 535 | want to create, antigen will work just fine with it. The `*.plugin.zsh` way is |
| 536 | recommended by antigen, because it is widely used because of the [oh-my-zsh][] | 536 | recommended by antigen, because it is widely used because of the [oh-my-zsh][] |
| 537 | project. | 537 | project. |
| 538 | 538 | ||
| 539 | If you want to know how antigen loads the plugins, do continue. | 539 | If you want to know how antigen loads the plugins, do continue. |
| 540 | 540 | ||
| 541 | Firstly, antigen looks for a `*.plugin.zsh` file in the plugin directory. If | 541 | Firstly, antigen looks for a `*.plugin.zsh` file in the plugin directory. If |
| 542 | present, it will source *only* this script. Nothing else is sourced. This is for | 542 | present, it will source *only* this script. Nothing else is sourced. This is for |
| 543 | oh-my-zsh style plugins. | 543 | oh-my-zsh style plugins. |
| 544 | 544 | ||
| 545 | Secondly, it looks for a `init.zsh` file in the plugin directory. If present, it | 545 | Secondly, it looks for a `init.zsh` file in the plugin directory. If present, it |
| 546 | will source *only* this script. Nothing else is sourced. This is for prezto | 546 | will source *only* this script. Nothing else is sourced. This is for prezto |
| 547 | style modules. | 547 | style modules. |
| 548 | 548 | ||
| 549 | Otherwise, it looks for `*.zsh` files and if there are any, *all* of them are | 549 | Otherwise, it looks for `*.zsh` files and if there are any, *all* of them are |
| 550 | sourced. The order in which they are sourced is not currently defined. Please | 550 | sourced. The order in which they are sourced is not currently defined. Please |
| 551 | don't rely on this order. Nothing else is sourced after all the `*.zsh` scripts. | 551 | don't rely on this order. Nothing else is sourced after all the `*.zsh` scripts. |
| 552 | 552 | ||
| 553 | If no `*.zsh` files are present, it finally looks for any `*.sh` files and | 553 | If no `*.zsh` files are present, it finally looks for any `*.sh` files and |
| 554 | sources *all* of them. Again, the order in which they are sourced in not | 554 | sources *all* of them. Again, the order in which they are sourced in not |
| 555 | currently defined. | 555 | currently defined. |
| 556 | 556 | ||
| 557 | No matter which (or none) of the above happen to be sourced, this plugin | 557 | No matter which (or none) of the above happen to be sourced, this plugin |
| 558 | directory is added to the zsh's function path (`$fpath`) so that any completions | 558 | directory is added to the zsh's function path (`$fpath`) so that any completions |
| 559 | in it are loaded. | 559 | in it are loaded. |
| 560 | 560 | ||
| 561 | One exception to this rule is that if this plugin is a theme. In which case the | 561 | One exception to this rule is that if this plugin is a theme. In which case the |
| 562 | theme script is just sourced and nothing else is done. Not even adding to | 562 | theme script is just sourced and nothing else is done. Not even adding to |
| 563 | `$fpath`. | 563 | `$fpath`. |
| 564 | 564 | ||
| 565 | ## A note on external zsh plugins | 565 | ## A note on external zsh plugins |
| 566 | 566 | ||
| 567 | Antigen downloads zsh scripts and sources them, according to your | 567 | Antigen downloads zsh scripts and sources them, according to your |
| 568 | specifications. As such, these scripts are capable of doing some *real* damage | 568 | specifications. As such, these scripts are capable of doing some *real* damage |
| 569 | to your system. If you are only downloading scripts from oh-my-zsh and/or | 569 | to your system. If you are only downloading scripts from oh-my-zsh and/or |
| 570 | prezto, you're probably fine, since there is a second level of manual checking | 570 | prezto, you're probably fine, since there is a second level of manual checking |
| 571 | before a script gets into the framework. | 571 | before a script gets into the framework. |
| 572 | 572 | ||
| 573 | But, if you are adding a script from any other source, please check the source | 573 | But, if you are adding a script from any other source, please check the source |
| 574 | code of the plugin to see its not doing anything malicious, before adding it to | 574 | code of the plugin to see its not doing anything malicious, before adding it to |
| 575 | your `.zshrc`. | 575 | your `.zshrc`. |
| 576 | 576 | ||
| 577 | ## Meta | 577 | ## Meta |
| 578 | 578 | ||
| 579 | ### Helping out | 579 | ### Helping out |
| 580 | 580 | ||
| 581 | Antigen is licensed with the [MIT License][license]. | 581 | Antigen is licensed with the [MIT License][license]. |
| 582 | 582 | ||
| 583 | To contribute, please read the [contributing wiki page][contributing] before | 583 | To contribute, please read the [contributing wiki page][contributing] before |
| 584 | sending pull requests. If its a long/complicated change, please consider opening | 584 | sending pull requests. If its a long/complicated change, please consider opening |
| 585 | an [issue][] first so we can discuss it out. Thanks! | 585 | an [issue][] first so we can discuss it out. Thanks! |
| 586 | 586 | ||
| 587 | ### Feedback please | 587 | ### Feedback please |
| 588 | 588 | ||
| 589 | Any comments/suggestions/feedback welcome. Please say hello to me | 589 | Any comments/suggestions/feedback welcome. Please say hello to me |
| 590 | ([@sharat87][twitter]) on twitter. Or open an issue to discuss something | 590 | ([@sharat87][twitter]) on twitter. Or open an issue to discuss something |
| 591 | (anything!) about the project ;). | 591 | (anything!) about the project ;). |
| 592 | 592 | ||
| 593 | 593 | ||
| 594 | [Vundle]: https://github.com/gmarik/vundle | 594 | [Vundle]: https://github.com/gmarik/vundle |
| 595 | [page on themes]: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | 595 | [page on themes]: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
| 596 | [wild]: https://github.com/zsh-users/antigen/wiki/In-the-wild | 596 | [wild]: https://github.com/zsh-users/antigen/wiki/In-the-wild |
| 597 | [syntax highlighting plugin]: https://github.com/zsh-users/zsh-syntax-highlighting | 597 | [syntax highlighting plugin]: https://github.com/zsh-users/zsh-syntax-highlighting |
| 598 | [autoenv]: https://github.com/kennethreitz/autoenv | 598 | [autoenv]: https://github.com/kennethreitz/autoenv |
| 599 | [f-autoenv]: https://github.com/sharat87/autoenv | 599 | [f-autoenv]: https://github.com/sharat87/autoenv |
| 600 | [oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh | 600 | [oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh |
| 601 | [cram]: https://bitheap.org/cram/ | 601 | [cram]: https://bitheap.org/cram/ |
| 602 | [issue]: https://github.com/zsh-users/antigen/issues | 602 | [issue]: https://github.com/zsh-users/antigen/issues |
| 603 | [license]: http://mit.sharats.me | 603 | [license]: http://mit.sharats.me |
| 604 | [contributing]: https://github.com/zsh-users/antigen/wiki/Contributing | 604 | [contributing]: https://github.com/zsh-users/antigen/wiki/Contributing |
| 605 | [twitter]: http://twitter.com/sharat87 | 605 | [twitter]: http://twitter.com/sharat87 |
| 606 | 606 |