Skip to content

subscribe / on-update-of

subscribe'' (alias on-update-of'') postpones loading a plugin or snippet until one or more specified files are modified on disk.

Terminal window
zi ice subscribe"{~/files-*,/tmp/files-*}"
zi ice on-update-of"~/my-config-file"

The ice value is a glob pattern (or brace-expanded list of patterns) pointing to file paths. Zinit checks whether any matching file has been updated since the last check. When a modification is detected, the plugin/snippet is loaded.

subscribe'' and on-update-of'' are interchangeable aliases.

Works with both plugins and snippets.

Terminal window
# Load a plugin only after a config file is updated
zi ice subscribe"~/.my-tool-config" lucid
zi light user/my-tool-plugin
  • wait
  • trigger-load