zsh: rework ZDOTDIR redirection
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
7aac214e04
commit
3321d21f8b
@ -2,7 +2,6 @@
|
|||||||
!/.cache/zsh/compcache/.keep
|
!/.cache/zsh/compcache/.keep
|
||||||
!/.cache/zsh/completion/.keep
|
!/.cache/zsh/completion/.keep
|
||||||
!/.cache/zsh/compzwc/.keep
|
!/.cache/zsh/compzwc/.keep
|
||||||
!/.cache/zsh/dots/.keep
|
|
||||||
!/.config/dotfiles/bin/.keep
|
!/.config/dotfiles/bin/.keep
|
||||||
!/.config/dotfiles/gen-gitignore.sh
|
!/.config/dotfiles/gen-gitignore.sh
|
||||||
!/.config/dotfiles/gitattributes
|
!/.config/dotfiles/gitattributes
|
||||||
@ -12,6 +11,7 @@
|
|||||||
!/.config/dotfiles/woodpecker.yml
|
!/.config/dotfiles/woodpecker.yml
|
||||||
!/.config/htop/htoprc.dist
|
!/.config/htop/htoprc.dist
|
||||||
!/.config/mc/ini.dist
|
!/.config/mc/ini.dist
|
||||||
|
!/.config/zsh.dots/.zshenv
|
||||||
!/.config/zsh/_.zsh
|
!/.config/zsh/_.zsh
|
||||||
!/.config/zsh/_wip/enclave.zsh.wip
|
!/.config/zsh/_wip/enclave.zsh.wip
|
||||||
!/.config/zsh/_wip/starship.zsh.sample
|
!/.config/zsh/_wip/starship.zsh.sample
|
||||||
|
6
.config/zsh.dots/.zshenv
Normal file
6
.config/zsh.dots/.zshenv
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
if [[ -o interactive ]] ; then
|
||||||
|
## early redirect
|
||||||
|
ZDOTDIR="${ZDOTDIR%/${ZDOTDIR:t2}}"
|
||||||
|
source "${ZDOTDIR}/.zshenv"
|
||||||
|
fi
|
@ -18,7 +18,7 @@ unsetopt global_rcs
|
|||||||
|
|
||||||
## safety measure:
|
## safety measure:
|
||||||
## redirect all following activity within ZDOTDIR to cache
|
## redirect all following activity within ZDOTDIR to cache
|
||||||
export ZDOTDIR="${ZSHU[d_cache]}/dots"
|
export ZDOTDIR="${ZDOTDIR}/.config/zsh.dots"
|
||||||
|
|
||||||
## cleanup: start from scratch
|
## cleanup: start from scratch
|
||||||
for i ( a s f d ) ; do unhash -$i -m '*' ; done ; unset i
|
for i ( a s f d ) ; do unhash -$i -m '*' ; done ; unset i
|
||||||
|
@ -63,6 +63,7 @@ z-reload() {
|
|||||||
## reload or new session are required to regenerate compcache
|
## reload or new session are required to regenerate compcache
|
||||||
z-cache-flush() {
|
z-cache-flush() {
|
||||||
find "${ZSHU[d_cache]}/" -xdev -type f '!' -name '.keep' -delete
|
find "${ZSHU[d_cache]}/" -xdev -type f '!' -name '.keep' -delete
|
||||||
|
find "${ZSHU[d_zdot]}/.config/zsh.dots/" -xdev -type f '!' -name '.zshenv' -delete
|
||||||
z-zwc-flush
|
z-zwc-flush
|
||||||
z-zwc-gen
|
z-zwc-gen
|
||||||
}
|
}
|
||||||
|
1
.zshenv
1
.zshenv
@ -2,6 +2,5 @@
|
|||||||
if [[ -o interactive ]] ; then
|
if [[ -o interactive ]] ; then
|
||||||
## early redirect
|
## early redirect
|
||||||
: "${ZDOTDIR:=${HOME}}"
|
: "${ZDOTDIR:=${HOME}}"
|
||||||
[ "${ZDOTDIR}" = "${HOME}/.cache/zsh/dots" ] && ZDOTDIR="${HOME}"
|
|
||||||
source "${ZDOTDIR}/.config/zsh/_.zsh"
|
source "${ZDOTDIR}/.config/zsh/_.zsh"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user