Subject: Re: Proof of concept mainstream plugin manager
From: Sebastian Gniazdowski <[email-masked]>
To: Daniel Shahaf <[email-masked]>
Cc: Zsh hackers list <[email-masked]>
Date: Wed, 27 Jan 2016 08:47:44 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 26 January 2016 at 23:50, Daniel Shahaf <[email-masked]> 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