Make config fully contained in xdg-dir (no ~/.zshenv)

This commit is contained in:
crater2150 2024-07-22 17:50:14 +02:00
parent 88a70e9bd4
commit c5548aaa22
2 changed files with 9 additions and 6 deletions

View file

@ -4,9 +4,14 @@ crater's zsh config
Installation: Installation:
------------- -------------
From the checked out repo: Set the `ZDOTDIR` environment variable to the directory of this repo. Note that
this environment variable must be set before the user configuration files of zsh
are read.
One way to do this is to set it in the global zsh configuration in
`/etc/zsh/zshenv`, e.g. to use the XDG basedir spec with this repo at
`~/.config/zsh`:
``` ```
ln -s $PWD/zshenv $HOME/.zshenv export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}"/zsh
``` ```
The zshenv file sets the location to the rest of the config (`$ZDOTDIR`)
automatically, based on the link target.

2
zshenv
View file

@ -1,5 +1,3 @@
export ZDOTDIR="${$(readlink $HOME/.zshenv):h:a}"
exists() { command -v "$@" >/dev/null } exists() { command -v "$@" >/dev/null }
function(){ function(){
local i local i