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

Re: Proof of concept mainstream plugin manager



On 26 January 2016 at 23:50, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Sebastian Gniazdowski wrote on Sun, Jan 24, 2016 at 11:51:49 +0100:
> I'd be more interested in the "How to
> package a plugin to make it loadable by zplugin" side of things.

    matches=(
        $dname/$pdir/init.zsh(N) $dname/${pdir}.plugin.zsh(N)
        $dname/${pdir}.zsh-theme(N) $dname/${pdir}.theme.zsh(N)
        $dname/${pdir}.zshplugin(N) $dname/${pdir}.zsh.plugin(N)
        $dname/*.plugin.zsh(N) $dname/*.zsh(N) $dname/*.sh(N)
    )
    [ "$#matches" -eq "0" ] && return 1
    local fname="${matches[1]#$dname/}"

That's how things are done currently. This is based on what zgen
checks for, but done better, I quess, in single line. So, to create a
plugin, a directory with e.g. "directoryname.plugin.zsh" is needed,
and then it can do autoloads and setopts, etc. Zplugin does more than
just sourcing, tracks e.g. the setopts, to report them and also to
allow unloading, with options restoration.

Best regards,
Sebastian Gniazdowski



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