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