|
| 1 | += antidote-bundle(1) |
| 2 | +:doctype: manpage |
| 3 | +:manmanual: Antidote Manual |
| 4 | +:mansource: antidote |
| 5 | + |
| 6 | +== Name |
| 7 | +antidote-bundle - download a bundle and print its source line |
| 8 | + |
| 9 | +== Synopsis |
| 10 | +*antidote bundle* [<bundles>...] |
| 11 | + |
| 12 | +== Description |
| 13 | +*antidote-bundle* assembles your Zsh plugins. Bundles can be git repos, or local files or directories. If a plugin is a repo, it will be cloned if necessary. The zsh code necessary to load (source) the plugin is then printed. |
| 14 | + |
| 15 | +---- |
| 16 | +antidote bundle gituser/gitrepo |
| 17 | +antidote bundle $ZSH_CUSTOM/plugins/myplugin |
| 18 | +antidote bundle ${ZDOTDIR:-$HOME}/.zlibs/myfile.zsh |
| 19 | +---- |
| 20 | + |
| 21 | +Bundles also support annotations. Annotations allow you have finer grained control over your plugins. Annotations are used in the form `keyword:value`. |
| 22 | + |
| 23 | +`kind`:: |
| 24 | + * *zsh*: A zsh plugin. This is the default kind of bundle. |
| 25 | + * *fpath*: Only add the plugin to your `$fpath`. |
| 26 | + * *path*: Add the plugin to your `$PATH`. |
| 27 | + * *clone*: Only clone a plugin, but don't do anything else with it. |
| 28 | + * *defer*: Defers loading of a plugin using `romkatv/zsh-defer`. |
| 29 | + * *autoload*: Autoload all the files in the plugin directory as zsh functions. |
| 30 | +`branch`:: |
| 31 | + The branch annotation allows you to change the default branch of a plugin's repo from *main* to a branch of your choosing. |
| 32 | +`path`:: |
| 33 | + The path annotation allows you to use a subdirectory or file within a plugin's structure instead of the root plugin (eg: `path:plugins/subplugin`). |
| 34 | +`conditional`:: |
| 35 | + The conditional annotation allows you to wrap an *if* statement around a plugin's load script. Supply the name of a zero argument zsh function to conditional to perform the test (eg: `conditional:is-macos`). |
| 36 | +`pre` / `post`:: |
| 37 | + The pre and post annotations allow you to call a function before or after a plugin's load script. This is helpful when configuring plugins, since the configuration functions will only run for active plugins. Supply the name of a zero argument zsh function to pre or post. |
| 38 | +`autoload`:: |
| 39 | + The autoload annotation allows you to autoload a zsh functions directory in addition to however the plugin was loaded as specified by `kind`. Supply a relative path to autoload (eg: `autoload:functions`). |
| 40 | + |
| 41 | +Cloned repo directory names can be overridden with the following `zstyle`: |
| 42 | + |
| 43 | +---- |
| 44 | +zstyle ':antidote:bundle' use-friendly-names 'yes' |
| 45 | +---- |
| 46 | + |
| 47 | +== Options |
| 48 | +*-h, --help*:: Show the help documentation. |
| 49 | +*<bundles>...*:: Zsh plugin bundles. |
| 50 | + |
| 51 | +== Examples |
| 52 | + |
| 53 | +Using the *kind:* annotation: |
| 54 | + |
| 55 | +---- |
| 56 | +# a regular plugin (kind:zsh is implied, so it's unnecessary) |
| 57 | +antidote bundle zsh-users/zsh-history-substring-search kind:zsh |
| 58 | +---- |
| 59 | + |
| 60 | +---- |
| 61 | +# add prompt plugins to $fpath |
| 62 | +antidote bundle sindresorhus/pure kind:fpath |
| 63 | +---- |
| 64 | + |
| 65 | +---- |
| 66 | +# add utility plugins to $PATH |
| 67 | +antidote bundle romkatv/zsh-bench kind:path |
| 68 | +---- |
| 69 | + |
| 70 | +---- |
| 71 | +# clone a repo for use in other ways |
| 72 | +antidote bundle mbadolato/iTerm2-Color-Schemes kind:clone |
| 73 | +---- |
| 74 | + |
| 75 | +---- |
| 76 | +# autoload a functions directory |
| 77 | +antidote bundle sorin-ionescu/prezto path:modules/utility/functions kind:autoload |
| 78 | +---- |
| 79 | + |
| 80 | +---- |
| 81 | +# defer a plugin to speed up load times |
| 82 | +antidote bundle olets/zsh-abbr kind:defer |
| 83 | +---- |
| 84 | + |
| 85 | +Using the *branch:* annotation: |
| 86 | + |
| 87 | +---- |
| 88 | +# don't use the main branch, use develop instead |
| 89 | +antidote bundle zsh-users/zsh-autosuggestions branch:develop |
| 90 | +---- |
| 91 | + |
| 92 | +Using the *path:* annotation: |
| 93 | + |
| 94 | +---- |
| 95 | +# load oh-my-zsh |
| 96 | +antidote bundle ohmyzsh/ohmyzsh path:lib |
| 97 | +antidote bundle ohmyzsh/ohmyzsh path:plugins/git |
| 98 | +---- |
| 99 | + |
| 100 | +Using the *conditional:* annotation: |
| 101 | + |
| 102 | +---- |
| 103 | +# define a conditional function prior to loading antidote |
| 104 | +function is_macos { |
| 105 | + [[ $OSTYPE == darwin* ]] || return 1 |
| 106 | +} |
| 107 | +
|
| 108 | +# conditionally load a plugin using the function you made |
| 109 | +antidote bundle ohmyzsh/ohmyzsh path:plugins/macos conditional:is_macos |
| 110 | +---- |
0 commit comments