Skip to content

Commit

Permalink
fixing kubectl completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Motevasselani committed Nov 19, 2022
1 parent 264e2c6 commit 9088d31
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions zsh/.zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@


#Prompt
autoload -Uz promptinit
promptinit

autoload -Uz +X promptinit && promptinit
autoload -Uz +X bashcompinit && bashcompinit
autoload -Uz +X compinit && compinit

#Right hand side of prompt
#RPROMPT=$'%.%'
Expand Down Expand Up @@ -43,12 +42,6 @@ select-word-style bash
zstyle :compinstall filename '/Users/cmotevasselani/.zshrc'


# insecure directories fix:
# https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories
autoload -Uz compinit
compinit
# End of lines added by compinstall

if [[ $TERM == "xterm-kitty" ]]
then
kitty + complete setup zsh | source /dev/stdin
Expand Down Expand Up @@ -111,27 +104,9 @@ alias less='less -R'
# TODO Git aliases
#cool log/graph: log --pretty=oneline -n 20 --graph --abbrev-commit




# Kubectl functions/aliases
function k() {
if [[ ! -z "$KUBERNETES_NAMESPACE" ]]
then
kubectl -n "$KUBERNETES_NAMESPACE" $@
else
kubectl $@
fi
}
alias kcc='k config current-context'
alias kgc='k config get-contexts'
alias kuc='k config use-context '

## Could not get kubectl completion working with `k`
alias k='kubectl'
source <(kubectl completion zsh)
complete -o default -F __start_kubectl k

#source <(k completion zsh | sed 's/kubectl/k/g')



Expand Down Expand Up @@ -174,10 +149,7 @@ alias start_armory_docker='docker run --name armory-halyard --rm \

alias kill_halyard="kill $(ps -ef | grep halyard | grep -v grep | head -1 | awk '{print $2}')"



complete -C /Users/cmotevasselani/bin/vault vault

complete -C /usr/local/bin/vault vault

# TOOD rbenv vs rvm?
# rbenv init
Expand Down

0 comments on commit 9088d31

Please sign in to comment.