jandamm / zgenom

A lightweight and fast plugin manager for ZSH
BSD 2-Clause "Simplified" License
363 stars 14 forks source link

Provide documentation on recommended way to configure installation and plugin directories #133

Closed montchr closed 1 year ago

montchr commented 1 year ago

I would like to keep my zgenom installation and sources in $XDG_DATA_HOME/zgenom instead of the default $HOME/.zgenom. What would be the simplest way to do so?

Initially, I set ZGEN_DIR to $XDG_DATA_HOME/zgenom and cloned the source repo there. However, I think I may be misusing that environment variable because now all the plugin downloads are dropped into the source directory. I didn't notice at first, but then I ran zgenom clean, which resulted in a broken zgenom because some essential source directories were removed.

Can the documentation be updated to include a list of supported environment variables and their purpose? Or at minimum, how to change the installation directory.

Also, I would recommend rewording this line in the readme:

The default $ZGEN_DIR is a sources subdirectory where you cloned zgenom to

I interpreted it to mean that $ZGEN_DIR is "where you cloned zgenom to".

jandamm commented 1 year ago

Sorry about that misunderstanding. That passage you found about $ZGEN_DIR is meant for those migrating from zgen. With zgen all plugins would be added to the directory where zgen was cloned to. With zgenom it's zgenom/sources so it's much easier to delete all plugins.

Most users shouldn't really set $ZGEN_DIR themselves.

If you want all zgenom related files in one place you should not set the $ZGEN_DIR and just install zgenom where you want it to be. All your installed plugins will be in path/of/zgenom/sources.

Regarding the environment variables. They're a leftover from zgen and most users shouldn't mess with them. There is no differentiation between config and internal variables. The user facing api is by now mostly exposed using commands instead.

jandamm commented 1 year ago

@montchr I also updated the README (in #135) Does this make it clearer?

montchr commented 1 year ago

It does, thanks for clarifying!