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/completion/.keep
|
||||
!/.cache/zsh/compzwc/.keep
|
||||
!/.cache/zsh/dots/.keep
|
||||
!/.config/dotfiles/bin/.keep
|
||||
!/.config/dotfiles/gen-gitignore.sh
|
||||
!/.config/dotfiles/gitattributes
|
||||
@ -12,6 +11,7 @@
|
||||
!/.config/dotfiles/woodpecker.yml
|
||||
!/.config/htop/htoprc.dist
|
||||
!/.config/mc/ini.dist
|
||||
!/.config/zsh.dots/.zshenv
|
||||
!/.config/zsh/_.zsh
|
||||
!/.config/zsh/_wip/enclave.zsh.wip
|
||||
!/.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:
|
||||
## redirect all following activity within ZDOTDIR to cache
|
||||
export ZDOTDIR="${ZSHU[d_cache]}/dots"
|
||||
export ZDOTDIR="${ZDOTDIR}/.config/zsh.dots"
|
||||
|
||||
## cleanup: start from scratch
|
||||
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
|
||||
z-cache-flush() {
|
||||
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-gen
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user