Feature request: Support adding and auto-updating of Oh My Zsh plugins without Oh My Zsh
arrrgi opened this issue · 12 comments
I would like to be able to add plugins from the Oh My Zsh repo without bringing in the base functions of Oh My Zsh which do things like compinit which we might not handle manually or at a later time.
I note other frameworks do support this already. This could be implemented in such a way that:
zgenom load ohmyzsh/oymyzsh lib/git
zgenom load ohmyzsh/oymyzsh plugins/osx
which points directly to a path within a repo and pulls the plugins/functions wanted, rather than needing the rest of the OMZ repo
I should add to this by saying that it looks like this is supported in some manner already in your docs. But doesn't seem to be working for me, hence the request to support the format above for loading plugins from a path.
Happy to be educated on how to do this properly if this is just simply me not understanding how to use the zgenom load
function correctly.
Hi @arrrgi,
thanks for pointing out that the README isn't clear enough about this "feature".
zgenom ohmyzsh # initialize ohmyzsh base
zgenom ohmyzsh plugins/osx # load plugin folder named 'osx' in the ohmyzsh repo
In the example above you can just comment out zgenom ohmyzsh
and it should work as wished.
The issues with the code you've posted above:
- there's a typo in
ohmyzsh/oymyzsh
oy
instead ofoh
lib/git
would need to belib/git.zsh
*
* The path to load needs to either be a folder or the full name of the file. plugin/osx
is a folder but lib/git.zsh
.
I'm not sure if I should check for missing file endings since there might be a folder lib/git
and then it might be that the file is loaded instead.
To clarify zgenom ohmyzsh
a bit:
It's actually nothing more than a thin wrapper around zgenom load ohmyzsh/ohmyzsh
.
It just makes sure that $ZSH
is set correctly and uses environment variables to define the branch/repo (in case you want to use a fork).
https://github.com/jandamm/zgenom/blob/main/functions/zgenom-ohmyzsh
Yes, sorry about the typo. I am using the correctly spelled version in my code, I fat fingered it when creating the issue here.
So if I want to just load lib/git.zsh and plugins/osx, I would simply need following in my config?
zgenom load lib/git.zsh
zgenom load plugins/osx
I don't want the rest of the OMZ framework cloned, just specific plugins or libs so that I can avoid all the other mess
No, you should use:
zgenom ohmyzsh lib/git.zsh
zgenom ohmyzsh plugins/osx
This ensures that $ZSH
(ohmyzsh uses this) is set.
Thanks, will try that out
Auto updating using zgenom autoupdate --background
should already be supported.
I'm also planning to disable ohmyzsh when zgenom autoupdate
is used.
What's the connection at the moment between the autoupdate function and OMZ?
zgenom autoupdate
will regularly update all git repos cloned via zgenom (including ohmyzsh) and zgenom itself.
ohmyzsh has a builtin function which checks for updates of only ohmyzsh.
So you don't need it if you use zgenom for automatic updates.
I'm also not sure if ohmyzsh updates user plugins which zgenom does.
I assume it did work for you, except the ohmyzsh issues?
Will let you know if I have any problems, assume for now it's good and I will test later :)