mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 17:54:35 +00:00
zsh: Optimize up loading shell completions
This commit is contained in:
parent
f765e8935b
commit
31da020c32
|
@ -2,7 +2,18 @@
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
zmodload -i zsh/complist # load completion list
|
zmodload -i zsh/complist # load completion list
|
||||||
compinit -d $ZSH_COMPDUMP # Specify compdump file
|
|
||||||
|
if [[ -n "$(print ${ZDOTDIR:-$HOME}/.zcompdump(Nmh+5))" ]]; then
|
||||||
|
# Re-check for new completions, re-creating .zcompdump if necessary.
|
||||||
|
# This check can be quite slow and it's rare that we actually have new completions to load.
|
||||||
|
# For that reason, we only do this if the compdump file is older than 5 hours.
|
||||||
|
compinit
|
||||||
|
else
|
||||||
|
# This will omit the check for new completions,
|
||||||
|
# only re-creating .zcompdump if it doesn't yet exist.
|
||||||
|
compinit -C
|
||||||
|
fi
|
||||||
|
|
||||||
zstyle ':completion:*' menu select # select completions with arrow keys
|
zstyle ':completion:*' menu select # select completions with arrow keys
|
||||||
zstyle ':completion:*' group-name '' # group results by category
|
zstyle ':completion:*' group-name '' # group results by category
|
||||||
zstyle ':completion:::::' completer _expand _complete _ignored _approximate # enable approximate matches for completion
|
zstyle ':completion:::::' completer _expand _complete _ignored _approximate # enable approximate matches for completion
|
||||||
|
|
Loading…
Reference in a new issue