cleanup of zlogin
Change the scope of the job: {} to (); removes need for unfunction Because we changed the job scope, we no longer need the anonymous function/local var.
This commit is contained in:
parent
b6b3620f34
commit
fb7defa729
@ -2,14 +2,15 @@
|
|||||||
# startup file read in interactive login shell
|
# startup file read in interactive login shell
|
||||||
# not run again in subsuquent shells
|
# not run again in subsuquent shells
|
||||||
#
|
#
|
||||||
|
|
||||||
# The following code helps us by optimizing the existing framework.
|
# The following code helps us by optimizing the existing framework.
|
||||||
# This includes zcompile, zcompdump, etc. Options can be adjusted in .zimrc
|
# This includes zcompile, zcompdump, etc.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Function to determine the need of a zcompile. If the .zwc file
|
(
|
||||||
# does not exist, or the base file is newer, we need to compile.
|
# Function to determine the need of a zcompile. If the .zwc file
|
||||||
local zcompare() {
|
# does not exist, or the base file is newer, we need to compile.
|
||||||
|
# These jobs are asynchronous, and will not impact the interactive shell
|
||||||
|
zcompare() {
|
||||||
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
|
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
|
||||||
# needs zcomplie
|
# needs zcomplie
|
||||||
zcompile ${1}
|
zcompile ${1}
|
||||||
@ -18,10 +19,8 @@ local zcompare() {
|
|||||||
# no need to zcompile
|
# no need to zcompile
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# These jobs are asynchronous, and will not impact the interactive shell
|
|
||||||
{
|
|
||||||
# First, we will zcompile the completion cache, if it exists. Siginificant speedup.
|
# First, we will zcompile the completion cache, if it exists. Siginificant speedup.
|
||||||
zcompare ${ZDOTDIR:-${HOME}}/.zcompdump
|
zcompare ${ZDOTDIR:-${HOME}}/.zcompdump
|
||||||
|
|
||||||
@ -36,14 +35,10 @@ local zcompare() {
|
|||||||
zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/completion/init.zsh
|
zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/completion/init.zsh
|
||||||
zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/custom/init.zsh
|
zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/custom/init.zsh
|
||||||
|
|
||||||
|
|
||||||
# Then, we should zcompile the 'heavy' modules where possible.
|
# Then, we should zcompile the 'heavy' modules where possible.
|
||||||
# This includes syntax-highlighting and completion.
|
# This includes syntax-highlighting and completion.
|
||||||
# Other modules may be added to this list at a later date.
|
# Other modules may be added to this list at a later date.
|
||||||
function {
|
zim=${ZDOTDIR:-${HOME}}/.zim
|
||||||
# use of anonymous function for setopt extended_glob
|
|
||||||
|
|
||||||
local zim=${ZDOTDIR:-${HOME}}/.zim
|
|
||||||
setopt EXTENDED_GLOB
|
setopt EXTENDED_GLOB
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -64,8 +59,6 @@ local zcompare() {
|
|||||||
if [[ -s ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh ]]; then
|
if [[ -s ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh ]]; then
|
||||||
zcompare ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh
|
zcompare ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
} &!
|
|
||||||
|
|
||||||
unfunction zcompare
|
) &!
|
||||||
|
Reference in New Issue
Block a user