tarjoilija/zgen

Removing Plugins

philFernandez opened this issue · 2 comments

Hello, I just found this and switched over from oh-my-zsh. I love the light weight aspect of this approach. I've been playing around with this all day, and I'm befuddled in regard to one thing. When removing plugins is the plugin manager supposed to delete the unwanted plugin directory from ~/.zgen?

I've installed a couple plugins that I ended up not wanting to use. To remove them I've simply deleted the line zgen load someUser/somePlugin from the ~/.zshrc, and then run zgen reset from the command line, followed by exec zsh.

This removes the plugin from the init.zsh file, but it leaves behind the directory and bits of the plugin being removed. Is there a way to have zgen clean out the bits and directories belonging to deleted plugins?

I've had a look at zgen and the main issue implementing a feature like this is that in the current state zgen only knows what plugins are loaded in the session after running zgen reset.
In this session all zgen load are done and zgen has a list of plugins. When zgen save is called all your plugins are written into a file which is then statically loaded.

I see two possible solutions for a zgen clean:
A) save the list into the static file so every session can share this information.
B) provide this functionality as zgen save --clean and clean up in the session after zgen reset.

In case you're still interested in this feature, I'd love to discuss it over at https://github.com/jandamm/zgenom where I'll explore how to implement it in a nice way.

I've added zgenom clean to my fork which removes all plugins not used in the current session. 👍