mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] improve compdump handling when initializing the completion system
This commit is contained in:
parent
c55c9af578
commit
1f97d82654
1 changed files with 26 additions and 3 deletions
|
@ -4,10 +4,33 @@ source "$ZSH_DOTFILES/zplg.zsh"
|
||||||
|
|
||||||
plugin completions 'zsh-users/zsh-completions'
|
plugin completions 'zsh-users/zsh-completions'
|
||||||
|
|
||||||
# Oh-My-Zsh {{{
|
run_compinit() {
|
||||||
|
autoload -U compinit
|
||||||
|
|
||||||
# initialize the completion system
|
local match run_compdump=1
|
||||||
autoload -Uz compinit && compinit -C
|
# glob qualifiers description:
|
||||||
|
# N turn on NULL_GLOB for this expansion
|
||||||
|
# . match only plain files
|
||||||
|
# m-1 check if the file was modified today
|
||||||
|
# see "Filename Generation" in zshexpn(1)
|
||||||
|
for match in $HOME/.zcompdump(N.m-1); do
|
||||||
|
run_compdump=
|
||||||
|
break
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "$run_compdump" ]]; then
|
||||||
|
# -D flag turns off compdump loading
|
||||||
|
compinit -D
|
||||||
|
compdump
|
||||||
|
else
|
||||||
|
# -C flag disables some checks performed by compinit - they are not needed
|
||||||
|
# because we already have a fresh compdump
|
||||||
|
compinit -C
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
run_compinit
|
||||||
|
|
||||||
|
# Oh-My-Zsh {{{
|
||||||
|
|
||||||
ZSH_CACHE_DIR="$ZSH_DOTFILES/cache"
|
ZSH_CACHE_DIR="$ZSH_DOTFILES/cache"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue