Commit
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# Delete zcompdump on config switch, so that we regenerate completions
|
||||
home.activation = {
|
||||
clearZshCompDump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
rm -f '${config.programs.zsh.dotDir}/.zcompdump*'
|
||||
rm -f "${config.programs.zsh.dotDir}"/.zcompdump*
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -17,20 +17,16 @@
|
||||
|
||||
enableCompletion = true;
|
||||
completionInit = ''
|
||||
setopt EXTENDED_GLOB
|
||||
|
||||
autoload -U compinit
|
||||
local dump_path="${config.programs.zsh.dotDir}/.zcompdump"
|
||||
local cache_check=( $dump_path(#qN.mh-24) )
|
||||
compinit -C
|
||||
|
||||
if (( $#cache_check )); then
|
||||
# Array has items: File exists and is new
|
||||
compinit -C
|
||||
else
|
||||
# Array is empty: File is older than 24 hours OR doesn't exist
|
||||
compinit
|
||||
zcompile "$dump_path" &
|
||||
fi
|
||||
ZCOMPDUMP="${config.programs.zsh.dotDir}/.zcompdump"
|
||||
# Compile it in the background
|
||||
{
|
||||
if [[ -s "$ZCOMPDUMP" && (! -s "''${ZCOMPDUMP}.zwc" || "$ZCOMPDUMP" -nt "''${ZCOMPDUMP}.zwc") ]]; then
|
||||
zcompile "$ZCOMPDUMP"
|
||||
fi
|
||||
} &!
|
||||
'';
|
||||
autosuggestion.enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user