1
0
dotfiles/.config/zsh/lib/selfservice.zsh

32 lines
780 B
Bash
Raw Normal View History

2021-03-21 18:25:10 +03:00
#!/bin/zsh
dotfiles-update() {
"${ZSHU[d_zdot]}/.config/dotfiles/install.sh"
}
2021-03-21 22:14:40 +03:00
dotfiles-git() { (
cd "${ZSHU[d_zdot]}/"
export GIT_DIR="${ZSHU[d_zdot]}/.config/dotfiles/repo.git"
export GIT_WORK_TREE="${ZSHU[d_zdot]}"
zsh -i
) }
2021-03-21 18:25:10 +03:00
z-update() {
dotfiles-update
2022-09-05 10:35:13 +03:00
for i ( $(find "${ZSHU[d_conf]}/" -xdev -type f -name '*.zsh') ) ; do
zcompile "$i"
done ; unset i
2021-03-21 18:25:10 +03:00
}
z-reload() {
exec -a "${ZSH_ARGZERO}" "${ZSH_NAME}" "${argv[@]}"
echo "unable to reload (something went wrong), code $?" 1>&2
}
2022-05-18 10:33:49 +03:00
## reload or new session are required to regenerate compcache
z-cache-flush() {
2022-09-05 10:35:13 +03:00
find "${ZSHU[d_cache]}/" "${ZSHU[d_compcache]}/" -xdev -type f '!' -name '.keep' -delete
find "${ZSHU[d_conf]}/" -xdev -type f -name '*.zwc' -delete
2022-05-18 10:33:49 +03:00
}