From f79acc771eeb7ab9e61d731ad210a06b164cf992 Mon Sep 17 00:00:00 2001 From: Marlon Richert Date: Tue, 2 May 2023 21:30:45 +0300 Subject: [PATCH] Add setting for `compinit` arguments Resolves #518. --- README.md | 7 +++++++ scripts/.autocomplete.compinit | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 645fcaf..b6386ea 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,13 @@ Try the steps in the The following are the most commonly requested ways to configure Autocomplete's behavior. Add these to your `.zshrc` file to use them. +### Pass arguments to `compinit` + +If necessary, you can let Autocomplete pass arguments to `compinit` as follows: +```sh +zstyle '*:compinit' arguments -D -i -u -C -w +``` + ### Reassign Tab You can reassign Tab to do something else than the default. This includes letting another plugin set it. Here are two examples of what you can diff --git a/scripts/.autocomplete.compinit b/scripts/.autocomplete.compinit index bcaea54..40423c2 100644 --- a/scripts/.autocomplete.compinit +++ b/scripts/.autocomplete.compinit @@ -58,7 +58,9 @@ compdef() { bindkey() { : } { builtin autoload +X -Uz compinit - compinit -d $_comp_dumpfile + local -a compargs=() + zstyle -a ':autocomplete::compinit' arguments compargs + compinit -d "$_comp_dumpfile" "$compargs[@]" } always { unfunction bindkey }