mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-25 22:22:31 +01:00
Add Docs
This commit is contained in:
parent
037c47c093
commit
c7d04c855f
74 changed files with 15437 additions and 248 deletions
24
docs/mkdocs/features/show_on_command.md
Normal file
24
docs/mkdocs/features/show_on_command.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Show on command
|
||||
|
||||
The behavior of some commands depends on global environment. For example, `kubectl run ...` runs an
|
||||
image on the cluster defined by the current kubernetes context. If you frequently change context
|
||||
between "prod" and "testing", you might want to display the current context in Zsh prompt. If you do
|
||||
likewise for AWS, Azure and Google Cloud credentials, prompt will get pretty crowded.
|
||||
|
||||
Enter _Show On Command_. This feature makes prompt segments appear only when they are relevant to
|
||||
the command you are currently typing.
|
||||
|
||||

|
||||
|
||||
Configs created by `p10k configure` enable show on command for several prompt segments by default.
|
||||
Here's the relevant parameter for kubernetes context:
|
||||
|
||||
```zsh
|
||||
# Show prompt segment "kubecontext" only when the command you are typing
|
||||
# invokes kubectl, helm, kubens, kubectx, oc, istioctl, kogito, k9s or helmfile.
|
||||
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile'
|
||||
```
|
||||
|
||||
To customize when different prompt segments are shown, open `~/.p10k.zsh`, search for
|
||||
`SHOW_ON_COMMAND` and either remove these parameters to display affected segments unconditionally,
|
||||
or change their values.
|
||||
Loading…
Add table
Add a link
Reference in a new issue