Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Please implement auto-handling of ${HOME}/.zsh/



Hey,

I'd love to have this, but two things that could be made even better
in my opinion:

1. Check $XDG_CONFIG_HOME/zsh as well as ~/.zsh. The former is from
the XDG Base Directory Specification[1] which I'd love to see zsh
follow. $XDG_CONFIG_HOME defaults to ~/.config if unset.

2. If one of those directories exists then look for $that_dir/zshenv
and not $that_dir/.zshenv. Hiding the files only makes sense for
$HOME, not for a sub-directory. Same should be true for
$that_dir/zshrc and the other files.

So my proposal would be:

- Look for an existing directory $XDG_CONFIG_HOME/zsh (if
$XDG_CONFIG_HOME is unset assume default $HOME/.config) or $HOME/.zsh
- If that directory exists set ZDOTDIR to it and read configuration
files from that directory. The files are not prefixed with .
- If that directory does not exist then proceed as before: read
configuration files from $HOME, the files are prefixed with .

Kind regards,
mosu



Messages sorted by: Reverse Date, Date, Thread, Author