mirror of
https://git.korhonen.cc/FunctionalHacker/dotfiles.git
synced 2024-11-10 13:10:26 +00:00
44a63ba8a4
first one executed
18 lines
427 B
Bash
18 lines
427 B
Bash
# from https://wiki.archlinux.org/index.php/Zsh#On-demand_rehash
|
|
|
|
zshcache_time="$(date +%s%N)"
|
|
|
|
autoload -Uz add-zsh-hook
|
|
|
|
rehash_precmd() {
|
|
if [[ -e /var/cache/zsh/pacman ]]; then
|
|
local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)"
|
|
if ((zshcache_time < paccache_time)); then
|
|
rehash
|
|
zshcache_time="$paccache_time"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
add-zsh-hook -Uz precmd rehash_precmd
|