Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Best practices for managing aliases in ohmyzsh?



On Tue, Aug 31, 2021 at 11:01 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> Aliases can invoke scripts just as easily as they can invoke functions.

However, the rules for scripts or functions invoking aliases are
considerably more convoluted.

Scripts can use aliases if the aliases are defined in a startup file
that the script loads, but any script using "zsh -f" will not load any
such files, so in practice scripts usually cannot use aliases.

Functions can use aliases (in general) if the alias is defined before
the function.  There's a whole section on this in the FAQ document.




Messages sorted by: Reverse Date, Date, Thread, Author