Skip to content

Commit

Permalink
Add setting for compinit arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed May 2, 2023
1 parent b6af173 commit d1f282b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
4 changes: 3 additions & 1 deletion functions/..znap.compinit-hook
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d1f282b

Please sign in to comment.