Merge pull request #106 from venyii/kubecontext-cluster-func

Fix a typo in docs.
This commit is contained in:
Roman Perepelitsa
2019-07-07 11:00:44 +02:00
committed by GitHub
3 changed files with 17 additions and 1 deletions
+13
View File
@@ -43,6 +43,19 @@ another
You can pick up a fix for the latter from You can pick up a fix for the latter from
[a fork of zsh](https://github.com/romkatv/zsh/tree/gentle-reset-prompt). [a fork of zsh](https://github.com/romkatv/zsh/tree/gentle-reset-prompt).
`POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION (FUNCTION) [default=""]`
Add your own function to modify the k8s context name, e.g. remove superfluous information:
```bash
# Input: gke_project-name-1337_europe-west1-c_production/ns
# Output: production
function k8s_context_short() {
echo "$1" | sed -E 's/.*-[a-z]_(.*)\/.*/\1/'
}
POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION="k8s_context_short"
```
When using gitstatus, there is an extra state called `LOADING` that is used by `vcs` prompt When using gitstatus, there is an extra state called `LOADING` that is used by `vcs` prompt
segment when it's waiting for git status in the background. You can define styling for this segment when it's waiting for git status in the background. You can define styling for this
state the same way as for the other states -- `CLEAN`, `UNTRACKED` and `MODIFIED`. You can state the same way as for the other states -- `CLEAN`, `UNTRACKED` and `MODIFIED`. You can
+1 -1
View File
@@ -205,7 +205,7 @@ budget for other plugins you might install.
Powerlevel10k is released under the Powerlevel10k is released under the
[MIT license](https://github.com/romkatv/powerlevel10k/blob/master/LICENSE). Contributions are [MIT license](https://github.com/romkatv/powerlevel10k/blob/master/LICENSE). Contributions are
convered by the same license. covered by the same license.
## FAQ ## FAQ
+3
View File
@@ -2142,6 +2142,9 @@ prompt_kubecontext() {
fi fi
done done
fi fi
if [[ -n $POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION ]]; then
ctx=$($POWERLEVEL9K_KUBECONTEXT_CONTEXT_FUNCTION $ctx)
fi
_p9k_cache_set "$ctx" "$suf" _p9k_cache_set "$ctx" "$suf"
fi fi