Skip to content

subst

subst'' performs text substitution in the plugin’s source script before it is sourced, replacing one string with another without modifying the file on disk.

Terminal window
zi ice subst"old-string → new-string"
zi ice subst"autoload → autoload -Uz"

The substitution is applied to the sourced content at load time. The original file on disk is unchanged. This allows fixing or patching plugin scripts that use patterns incompatible with the user’s Zsh setup.

The separator is (Unicode right arrow) or -> (ASCII arrow).

Terminal window
# Ensure all autoload calls use -Uz flags
zi ice subst"autoload → autoload -Uz"
zi light user/old-plugin
  • aliases