From 1af74ea9edde7f3cec1f63068dc4f5aad2dcad68 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Tue, 5 Jun 2012 15:27:15 +0530 Subject: [PATCH] Load completions after bundles are loaded. bundle-init is now renamed to bundle-apply and is to called after all bundle specifications are given. Also added notes in the README file. The reason is the compinit function needs to be run after adding all the required directories to `fpath`. The only reliable and performant way to do it would be to explicitly call a function that does it after specifying all the bundles. --- README.mkd | 17 +++++++++++++++++ antigen.zsh | 3 +-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.mkd b/README.mkd index fd06146..0452a9e 100644 --- a/README.mkd +++ b/README.mkd @@ -32,6 +32,9 @@ might look like this # Load the theme. bundle-theme robbyrussell + # Tell antigen that you're done. + bundle-apply + Open your zsh with this zshrc and run `bundle-install` and you should be ready to roll. The complete syntax for the `bundle` command is discussed further down on this page. @@ -184,6 +187,20 @@ want to use. Currently, themes are pulled from robbyrussell's oh-my-zsh repo, but it will support getting themes from other repos as well in the future. +## bundle-apply + +You have to add this command after defining all bundles you need, in your zshrc. +The completions defined by your bundles will be loaded at this step. + +It is possible to load completions as and when a bundle is specified with the +bundle command, in which case this command would not be necessary. But loading +the completions is a time-consuming process and your shell will start noticeably +slow if you have a good number of bundle specifications. + +However, if you're a zsh expert and can suggest a way so that this would not be +necessary, I am very interested in discussing it. Please open up an issue with +your details. Thanks. + # Configuration The following environment variables can be set to customize the behavior of diff --git a/antigen.zsh b/antigen.zsh index 268c6ce..75d43af 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -196,7 +196,7 @@ bundle-theme () { bundle "$url" --name=$name.theme --loc=themes/$name.zsh-theme } -bundle-init () { +bundle-apply () { # Initialize completion. if ! type compinit &>/dev/null; then autoload -U compinit @@ -227,4 +227,3 @@ echo-non-empty () { } -bundle-env-setup -bundle-init -- 2.0.0