diff --git a/README.md b/README.md index 1af7f3e..08c62a4 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,11 @@ Note that the above example does not include any call to `bashcompinit`](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization) in the `.zshrc` file. That is because Znap will run these for you as needed. +If necessary, you can let Znap pass arguments to `compinit` as follows: +```sh +zstyle '*:compinit' arguments -D -i -u -C -w +``` + ### Asynchronous compilation Znap compiles your scripts and functions in the background. This way, your shell will start up even faster next time! diff --git a/functions/..znap.compinit-hook b/functions/..znap.compinit-hook index aa6acac..acc34e2 100644 --- a/functions/..znap.compinit-hook +++ b/functions/..znap.compinit-hook @@ -10,7 +10,9 @@ if ! [[ -v _comp_setup && -f $_comp_dumpfile ]]; then autoload -Uz compinit bindkey() {:} { - compinit -d $_comp_dumpfile + local -a compargs=() + zstyle -a ':autocomplete::compinit' arguments compargs + compinit -d "$_comp_dumpfile" "$compargs[@]" } always { unfunction bindkey }