zsh-users / antigen

The plugin manager for zsh.
http://antigen.sharats.me
MIT License
8.01k stars 279 forks source link

zstyle not being set #703

Open RedHatter opened 4 years ago

RedHatter commented 4 years ago

I'm trying to convert my zshrc to use antigen but I'm having some problems. It doesn't look like zstyle settings are being passed to the plugins. For example, zsh-notify loaded with antigen ignores any settings but when I source the file directly everything works fine.

antigen bundle marzocchi/zsh-notify
zstyle ':notify:*' command-complete-timeout 1
source $ADOTDIR/bundles/marzocchi/zsh-notify/notify.plugin.zsh
zstyle ':notify:*' command-complete-timeout 1
Matts966 commented 3 years ago

antigen loads plugins when using antigen apply, and marzocchi/zsh-notify calls zstyle ':notify:*' command-complete-timeout 30 when loaded. So we should call zstyle ':notify:*' command-complete-timeout 1 after loading marzocchi/zsh-notify.

Working example with zplug is

_notify_timeout() { zstyle ':notify:*' command-complete-timeout 3 }
zplug "marzocchi/zsh-notify", hook-load: '_notify_timeout'