Commit 3047bfeb736c3e10ee061fdfe8de9f935e821656
1 parent
1af74ea9ed
Load compinit at startup too.
compinit needs to be loaded at startup too, or the compdef function won't be defined.
Showing 1 changed file with 7 additions and 3 deletions Side-by-side Diff
antigen.zsh
... | ... | @@ -198,9 +198,6 @@ bundle-theme () { |
198 | 198 | |
199 | 199 | bundle-apply () { |
200 | 200 | # Initialize completion. |
201 | - if ! type compinit &>/dev/null; then | |
202 | - autoload -U compinit | |
203 | - fi | |
204 | 201 | compinit -i |
205 | 202 | } |
206 | 203 | |
... | ... | @@ -212,10 +209,17 @@ echo-non-empty () { |
212 | 209 | } |
213 | 210 | |
214 | 211 | -bundle-env-setup () { |
212 | + # Pre-startup initializations | |
215 | 213 | -set-default ANTIGEN_DEFAULT_REPO_URL \ |
216 | 214 | https://github.com/robbyrussell/oh-my-zsh.git |
217 | 215 | -set-default ANTIGEN_REPO_CACHE $HOME/.antigen/cache |
218 | 216 | -set-default ANTIGEN_BUNDLE_DIR $HOME/.antigen/bundles |
217 | + | |
218 | + # Load the compinit module | |
219 | + autoload -U compinit | |
220 | + | |
221 | + # Without the following, `compdef` function is not defined. | |
222 | + compinit -i | |
219 | 223 | } |
220 | 224 | |
221 | 225 | # Same as `export $1=$2`, but will only happen if the name specified by `$1` is |