Change z command logic

This commit is contained in:
Andrea Mistrali 2023-10-10 12:24:53 +02:00
parent 34b07d5610
commit 1d175dd9cc
Signed by: andre
SSH Key Fingerprint: SHA256:/D780pZnuHMQ8xFII5lAtXWy8zdowtBhgWjwi88p+lI
2 changed files with 11 additions and 3 deletions

View File

@ -15,4 +15,4 @@ PURE_CMD_MAX_EXEC_TIME=30
# prompt mypure
# prompt pure
# vim: set ts=4 sw=4 tw=0 ft=zsh :
# vim: set ts=4 sw=4 tw=0 ft=zsh :

View File

@ -10,12 +10,20 @@ whence thefuck > /dev/null && eval $(thefuck --alias)
# z
# [ -f $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh ] && source $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh
whence zoxide > /dev/null && eval eval "$(zoxide init zsh)"
if [ $(whence zoxide > /dev/null) ]; then ## zoxide is installed
eval $(zoxide init zsh)
export Z_COMMAND=zoxide
elif [ -f $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh ]; then ## zsh-z is installed
source $LIBRARY/plugins/zsh-z/zsh-z.plugin.zsh
export Z_COMMAND=zsh-z
else
echo "No zoxide or zsh-z found, z command disabled"
fi
# kubectl/krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
if whence kubectl > /dev/null; then
if whence kubectl > /dev/null; then
alias k=kubectl
alias kk='kubectl konfig merge ~/.kube/configs/* > ~/.kube/config'
fi