[completion] add ${zcompdump_file} option

This commit assumes that the user-provided variable for the filename
will start with '.zcomp'. This is used in the .zlogin for zcompiling the
completion file. Sourcing the .zimrc file within the .zlogin file is
something I'd rather not do, and this seems like a good compromise. If
this becomes an issue, the file can be sourced an the var can be used
instead.

Closes #42
This commit is contained in:
Matt Hamilton 2016-04-16 14:56:46 -07:00
parent fcc4c573a8
commit 4ac66646c4
3 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,7 @@ fi
fpath=(${0:h}/external/src ${fpath})
# load and initialize the completion system
autoload -Uz compinit && compinit -C -d ${ZDOTDIR:-${HOME}}/.zcompdump
autoload -Uz compinit && compinit -C -d "${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}"
# set any compdefs
source ${0:h}/compdefs.zsh

View File

@ -24,6 +24,14 @@ zmodules=(directory environment git history input utility custom \
# Set your desired prompt here
zprompt_theme='steeef'
#
# Completion
#
# set an optional host-specific filename for the completion cache file
# if none is provided, the default '.zcompdump' is used.
#zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"
#
# Utility
#

View File

@ -19,7 +19,9 @@
setopt EXTENDED_GLOB
# zcompile the completion cache; siginificant speedup.
zcompare ${ZDOTDIR:-${HOME}}/.zcompdump
for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do
zcompare ${file}
done
# zcompile .zshrc
zcompare ${ZDOTDIR:-${HOME}}/.zshrc