From 18249921c29c00dd741d1610132b01871f4e2afe Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Fri, 13 Jul 2012 23:27:53 +0530 Subject: [PATCH] Notes on writing plugins. --- README.mkd | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.mkd b/README.mkd index 58ba282..832c69d 100644 --- a/README.mkd +++ b/README.mkd @@ -403,7 +403,27 @@ functionality of antigen. ## Notes on writing plugins -> *TBD* +If you are just going to write a single `.sh` file with the goodness you want to +create, just forget about this and go do that. Antigen will work just find with +such a plugin. + +If you want to know how antigen loads the plugins, do continue. + +Firstly, antigen looks for a `*.plugin.zsh` file in the plugin directory. If +present, it will source *only* this script. Nothing else is sourced. + +Otherwise, it looks for `*.zsh` files and if there are any, *all* of them are +sourced. The order in which they are sourced is not currently defined. Please +don't rely on this order. Nothing else is sourced after all the `*.zsh` scripts. + +If no `*.zsh` files are present, it finally looks for any `*.sh` files and +sources *all* of them. Again, the order in which they are sourced in not +currently defined. + +No matter which (or none) of the above happen to be sourced, this plugin +directory is added to the zsh's function path (`$fpath`) so that any completions +in it are loaded. One exception to this rule is that if this plugin is a prompt +theme. In which case the theme script is just sourced and nothing else is done. ## Meta -- 2.0.0