tarjoilija / zgen

A lightweight and simple plugin manager for ZSH
BSD 2-Clause "Simplified" License
1.49k stars 98 forks source link

Implement 2 paragraphs (1st and 5th) of the plugin standard #124

Open psprint opened 4 years ago

psprint commented 4 years ago

I thought that I'll implement some of the paragraphs of the plugin standard. The PR implements paragraph 1 and 5:

  1. Provide the $ZERO parameter – a sister parameter to the $0.
  2. Provide the $zsh_loaded_plugins array.

The details are on the link. The PR doesn't cover Prezto modules, however they don't rely on $ZERO and $zsh_loaded_plugins parameters. The standard has some adoption now, e.g.: GitHub search. Most of the plugins are mine, however c.a. 50% are other authors.

Example init.zsh generated:

# {{{
# Generated by zgen.
# This file will be overwritten the next time you run zgen save!

ZSH=/root/.zgen/robbyrussell/oh-my-zsh-master

# ### General modules
typeset -ga zsh_loaded_plugins

# zdharma/zconvey
zsh_loaded_plugins+=( "zdharma/zconvey" )
ZERO="/root/.zgen/zdharma/zconvey-master/zconvey.plugin.zsh"
source "/root/.zgen/zdharma/zconvey-master/zconvey.plugin.zsh"

# fast-syntax-highlighting
zsh_loaded_plugins+=( "/fast-syntax-highlighting" )
ZERO="/root/my-plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
source "/root/my-plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"

# robbyrussell/oh-my-zsh/oh-my-zsh.sh
zsh_loaded_plugins+=( "robbyrussell/oh-my-zsh/oh-my-zsh.sh" )
ZERO="/root/.zgen/robbyrussell/oh-my-zsh-master/oh-my-zsh.sh"
source "/root/.zgen/robbyrussell/oh-my-zsh-master/oh-my-zsh.sh"

# robbyrussell/oh-my-zsh/lib/git.zsh
zsh_loaded_plugins+=( "robbyrussell/oh-my-zsh/lib/git.zsh" )
ZERO="/root/.zgen/robbyrussell/oh-my-zsh-master/lib/git.zsh"
source "/root/.zgen/robbyrussell/oh-my-zsh-master/lib/git.zsh"

# robbyrussell/oh-my-zsh/plugins/git
zsh_loaded_plugins+=( "robbyrussell/oh-my-zsh/plugins/git" )
ZERO="/root/.zgen/robbyrussell/oh-my-zsh-master/plugins/git/git.plugin.zsh"
source "/root/.zgen/robbyrussell/oh-my-zsh-master/plugins/git/git.plugin.zsh"
unset ZERO

# ### Plugins & Completions
fpath=(/root/my-plugins/fast-syntax-highlighting /root/.zgen/zdharma/zconvey-master /root/.zgen/robbyrussell/oh-my-zsh-master/plugins/git /root/.zgen/robbyrussell/oh-my-zsh-master/lib ${fpath})

# }}}
jubishop commented 4 years ago

this is awesome.

psprint commented 4 years ago

Hi. Any update on this? I could revise the PR and thoroughly test it once more if it has any chance of merging.