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