Skip to content

zsh autoload #4

@jdhao

Description

@jdhao
  1. autoload is a zsh builtin, its doc can be found in man zhsbuiltins.
    • -U: alias expansion is suppressed when the function is loaded.
    • -z: The flags -z and -k mark the function to be autoloaded using the zsh or ksh style, as if the option KSH_AUTOLOAD were unset or were set, respectively

the meaning of KSH_AUTOLOAD is defined in man zhsoptions:

Emulate ksh function autoloading. This means that when a function is autoloaded, the corresponding file is merely executed, and must define the function itself. (By default, the function is defined to the contents of the file. However, the most common ksh-style case - of the file containing only a simple definition of the function - is always handled in the ksh-compatible manner.)

  1. autoloading functions: https://zsh.sourceforge.io/Doc/Release/Functions.html
  2. what does autoload do in Zsh? https://stackoverflow.com/q/30840651/6064933
  3. zsh autoload, what is it good for? https://stackoverflow.com/q/4493173/6064933

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions