update folderstructure to match xdg-ninja
This commit is contained in:
parent
ec2e91d063
commit
50ecdf4696
1040 changed files with 1898 additions and 2830 deletions
|
@ -0,0 +1,26 @@
|
|||
# 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%}"
|
||||
```
|
||||
|
||||

|
||||

|
|
@ -0,0 +1,13 @@
|
|||
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/%/%%}}"
|
||||
}
|
BIN
zsh/.local/share/oh-my-zsh/.oh-my-zsh/plugins/kubectx/prod.png
Normal file
BIN
zsh/.local/share/oh-my-zsh/.oh-my-zsh/plugins/kubectx/prod.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
zsh/.local/share/oh-my-zsh/.oh-my-zsh/plugins/kubectx/stage.png
Normal file
BIN
zsh/.local/share/oh-my-zsh/.oh-my-zsh/plugins/kubectx/stage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Loading…
Add table
Add a link
Reference in a new issue