Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow multiple plugins from one repository #86

Open
nineboxes opened this issue Dec 18, 2022 · 3 comments
Open

Feature Request: Allow multiple plugins from one repository #86

nineboxes opened this issue Dec 18, 2022 · 3 comments

Comments

@nineboxes
Copy link

Hi there!

Currently zap tends you to create repository for each plugin you need. It's OK for some kind of public plugins but when you develop your own config usually you want to put all plugins in one place. In this case it would be nice to have a command that allows to "bundle" all plugins from the repository. For example, I have a repo with files:

├ my-exa.plugin.zsh
├ my-vim.plugin.zsh
├ my-work-prompt.plugin.zsh
└ my-home-prompt.plugin.zsh

And somewhere in the .zshrc I just simply write:

…
bundle "username/zap-config"

And all these plugins should be sourced.


Also (I'm not sure if we can do it in bash) additionally it would be nice to have an option that can skip one or more plugins from the repo. For example, in my current repo I have two plugins for prompt and for my home machine I want to use only my-home-prompt.plugin.zsh by excluding my-work-prompt.plugin.zsh like this:

# my home bash config
…
bundle "username/zap-config" -e my-work-prompt my-vim # also exclude my-vim

The reason because we should add "exclude" instead of some kind of white/black lists is that "Zap is a minimal zsh plugin manager" and we should expect the default behavior as it is without any complex side effects.

@mamaraddio
Copy link
Member

mamaraddio commented Dec 28, 2022

Technically me, Chris , or any other zap cantributor, could work on this feature but I think this leads to a "side effect": this addition will grow the codebase making the concept of zap "less minimal".
Could also be an idea to create two different branches like "minimal" (that will be the default branch) and "extended" (that will contains all these, and/or future, new features) and the users will chose which branch to checkout when installing zap.

For now a workaround could be to clone your repo somewhere and then put the following lines in you ". zshrc"

for plugin in path_to_repo/*; do
    plug "path_to_repo/$plugin"
done

In these way zap should source all the plugins in that directory but you'll need to manually clone it on your system and if you want to exclude a plugin you have to remove/move that plugin, and maybe you'll need to delete all "non plugin" files/folders to avoid unexpected behaviours

@ChristianChiarulli what do you think about it?

@ChristianChiarulli
Copy link
Member

Is this a common convention implemented by other plugin managers and often implemented for plugins?

@wintermi
Copy link
Contributor

wintermi commented Jan 26, 2023

Not sure that it is a common convention but there are other plugin managers such as 'zplug' which have tags that could cater for this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants