Skip to content

Commit

Permalink
Omit kubenetes settings since I do not use it recently. Let's speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
ohbarye committed Jul 18, 2021
1 parent 3c51bb8 commit 445e4d0
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -165,37 +165,40 @@ function fzf-find-file() {
zle -N fzf-find-file
bindkey '^q' fzf-find-file

if [ $commands[kubectl] ]; then
source <(kubectl completion zsh)
fi

# AWS
alias am='aws-mfa --duration 86400'

# Kubernetes settings
alias ks='kubectl'

kss() {
ks config get-contexts | sed "/^\ /d"
ks auth can-i get ns >/dev/null 2>&1 && echo "(Authorized)" || echo "(Unauthorized)"
}

kc() {
test "$1" = "-" && kubectx - || kubectx "$(kubectx | fzf)"
}

kn() {
test "$1" = "-" && kubens - || kubens "$(kubens | fzf)"
}

autoload -U colors; colors

# Temporary off since I don't care it so frequently.
# Kubernetes settings start
# Temporary off since I don't use kubernetes recently.
# alias ks='kubectl'
#
# kss() {
# ks config get-contexts | sed "/^\ /d"
# ks auth can-i get ns >/dev/null 2>&1 && echo "(Authorized)" || echo "(Unauthorized)"
# }
#
# kc() {
# test "$1" = "-" && kubectx - || kubectx "$(kubectx | fzf)"
# }
#
# kn() {
# test "$1" = "-" && kubens - || kubens "$(kubens | fzf)"
# }
#
# if [ $commands[kubectl] ]; then
# source <(kubectl completion zsh)
# fi
#
# if [ -f "/usr/local/etc/zsh-kubectl-prompt/kubectl.zsh" ]; then
# source /usr/local/etc/zsh-kubectl-prompt/kubectl.zsh
# RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'
# fi

# Kubernetes settings end


autoload -U colors; colors

# For profiling https://qiita.com/vintersnow/items/7343b9bf60ea468a4180
# If it's unnecessary, comment out `zmodload zsh/zprof && zprof` in .zshenv
if (which zprof > /dev/null 2>&1) ;then
Expand Down

0 comments on commit 445e4d0

Please sign in to comment.