chore(zsh): various tweaks to zsh env setup and helpers

This commit is contained in:
2024-01-06 15:10:15 +00:00
parent a304b0bb26
commit 9526b57d38
6 changed files with 46 additions and 16 deletions

View File

@@ -2,10 +2,6 @@
# Google Cloud SDK setup.
#
if [ -f '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc' ]; then
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc'
fi
# Lazy load gcloud shell completion on first use.
if command-exists gcloud; then
_python_argcomplete() {
@@ -17,8 +13,8 @@ if command-exists gcloud; then
load-gcloud-completion() {
unset -f load-gcloud-completion _python_argcomplete
if [ -f '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc' ]; then
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'
if [ -n "$HOMEBREW_PREFIX" ]; then
source-if-exists "${HOMEBREW_PREFIX}/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
fi
}
fi

View File

@@ -23,11 +23,13 @@ if command-exists kubectl; then
}
_setup-kubectl-completion
switch() {
unset -f switch
source "$(brew --prefix switch)/switch.sh"
switch "$@"
}
if command-exists brew-prefix; then
switch() {
unset -f switch
source "$(brew-prefix switch)/switch.sh"
switch "$@"
}
fi
export KREW_ROOT="$HOME/.krew"
path_append "${KREW_ROOT}/bin"