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

Writing Zsh "libraries"



As I have quite a few utilities written in pure Zsh, I've created a
small library of functions that I often (re)use.  The question is how
to store such a library.  Currently, I've just placed them in
$ZDOTDIR/functions/zap and then added that directory to $fpath.  That
works fine, but I need to modify $fpath and prefix functions with
"zap-".  Then I had the "brilliant" idea of removing the prefixes -
thus "zap-init" becomes "init" - and load them in the following manner
instead:

autoload -U zap/init

Then I simply call the function as "zap/init" ($ZDOTDIR/functions is
in my $fpath as well).

This works and seems to be quite a nice way to handle namespacing, but
perhaps I'm missing something vital here.

Any comments?

 nikolai



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