diff options
author | 2024-03-25 16:43:09 +0530 | |
---|---|---|
committer | 2024-03-25 16:43:09 +0530 | |
commit | a62114c91f2070c8c8453d117f3d81dc113e41ff (patch) | |
tree | f266e87af29a08c01f82bc32dd7d463d8ec4441a /zsh/oh-my-zsh/plugins/kubectx | |
parent | af120ab348f2e1a5a39dec035ed9dcf84189a64e (diff) | |
download | dotfiles-a62114c91f2070c8c8453d117f3d81dc113e41ff.tar.gz dotfiles-a62114c91f2070c8c8453d117f3d81dc113e41ff.tar.bz2 dotfiles-a62114c91f2070c8c8453d117f3d81dc113e41ff.zip |
dotfile update
Diffstat (limited to 'zsh/oh-my-zsh/plugins/kubectx')
-rw-r--r-- | zsh/oh-my-zsh/plugins/kubectx/README.md | 26 | ||||
-rw-r--r-- | zsh/oh-my-zsh/plugins/kubectx/kubectx.plugin.zsh | 13 | ||||
-rw-r--r-- | zsh/oh-my-zsh/plugins/kubectx/prod.png | bin | 3834 -> 0 bytes | |||
-rw-r--r-- | zsh/oh-my-zsh/plugins/kubectx/stage.png | bin | 3829 -> 0 bytes |
4 files changed, 0 insertions, 39 deletions
diff --git a/zsh/oh-my-zsh/plugins/kubectx/README.md b/zsh/oh-my-zsh/plugins/kubectx/README.md deleted file mode 100644 index 98f1cf0..0000000 --- a/zsh/oh-my-zsh/plugins/kubectx/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# kubectx - show active kubectl context - -This plugins adds ```kubectx_prompt_info()``` function. It shows name of the -active kubectl context (```kubectl config current-context```). - -You can use it to customize prompt and know if You are on prod cluster ;) - -_Example_. Add to **.zshrc**: - -``` -RPS1='$(kubectx_prompt_info)' -``` - -### custom ctx names - -One can rename default context name for better readability. - -_Example_. Add to **.zshrc**: -``` -kubectx_mapping[minikube]="mini" -kubectx_mapping[context_name_from_kubeconfig]="$emoji[wolf_face]" -kubectx_mapping[production_cluster]="%{$fg[yellow]%}prod!%{$reset_color%}" -``` - - - diff --git a/zsh/oh-my-zsh/plugins/kubectx/kubectx.plugin.zsh b/zsh/oh-my-zsh/plugins/kubectx/kubectx.plugin.zsh deleted file mode 100644 index 6096fee..0000000 --- a/zsh/oh-my-zsh/plugins/kubectx/kubectx.plugin.zsh +++ /dev/null @@ -1,13 +0,0 @@ -typeset -g -A kubectx_mapping - -function kubectx_prompt_info() { - (( $+commands[kubectl] )) || return - - local current_ctx=$(kubectl config current-context 2> /dev/null) - - [[ -n "$current_ctx" ]] || return - - # use value in associative array if it exists - # otherwise fall back to the context name - echo "${kubectx_mapping[$current_ctx]:-${current_ctx:gs/%/%%}}" -} diff --git a/zsh/oh-my-zsh/plugins/kubectx/prod.png b/zsh/oh-my-zsh/plugins/kubectx/prod.png Binary files differdeleted file mode 100644 index 0c194a6..0000000 --- a/zsh/oh-my-zsh/plugins/kubectx/prod.png +++ /dev/null diff --git a/zsh/oh-my-zsh/plugins/kubectx/stage.png b/zsh/oh-my-zsh/plugins/kubectx/stage.png Binary files differdeleted file mode 100644 index ac15b39..0000000 --- a/zsh/oh-my-zsh/plugins/kubectx/stage.png +++ /dev/null |