1

For my local dotfiles I have this snippet at the end of my .zshrc:

for f in ~/.zshrc ~/.zshenv ; do
    [ "${f}"(:A) -ot "$f".zwc ] || zcompile "$f"
done

This ensures that these scripts are always precompiled if modified.

But global scripts that I source are much more heavy-weight, for example /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh, /usr/share/doc/fzf/examples/completion.zsh or /usr/share/doc/fzf/examples/key-bindings.zsh.

Is there a good solution how to zcompile these, ideally globally for all users? Or should I just resort to copy them locally into my $HOME and zcompile there?

1
  • I'm not sure if I get what you mean with "good solution". Naive approach: Have maybe a cronjob (periodically or on system-boot) to compile the system-wide files the same way you do it with your user's files?
    – mpy
    Commented Sep 2, 2023 at 9:31

0

You must log in to answer this question.

Browse other questions tagged .