I just added the Powerlevel10k theme to my zsh and i'm trying to configure certain parts.
It currently looks like this:
The ~/.p10k.zsh
has a lot of configurations done and I've been trying to change certain things but i'm not there yet.
I don't want to print the whole path on the left prompt, just the directory. Also, not sure what those numbers indicate in the git section. And the right prompt is displaying my ruby version, although I haven't used Ruby in ages and want to change it to a different setting.
I've tried adding a PS1=...
to .zshrc
but it seems to be overriden by the P10K config file.
Any suggestions?
Transient prompt, when enabled, replaces the prompt with a simpler one to allow more screen real estate. You can use go text/template templates extended with sprig to enrich the text. All template functionality is available, even reusing cross segment template properties from the previous primary prompt run.
Powerlevel10k has a new feature called Instant Prompt. Once enabled, Powerlevel10k prompt will appear instantly after you start zsh, allowing you to get hacking right away. No configuration is required. You'll get instant prompt with the style of your choice even if your zsh configs pull in half the universe.
~/.p10k.zsh
.POWERLEVEL9K_SHORTEN_STRATEGY
.truncate_to_last
.Alternatively, change the value of POWERLEVEL9K_DIR_MAX_LENGTH
to 1
. This will maximally shorten current directory while keeping the transformation reversible. You can restore the original directory by copy-pasting the shortened directory to the command line and pressing TAB
.
Powerlevel10k has several prompt segments that can display Ruby version. By default only those are enabled that display Ruby version when it has been manually overridden by some tool (e.g., rbenv
or asdf
).
To remove Ruby version from prompt:
~/.p10k.zsh
.POWERLEVEL9K_RIGHT_PROMPT_SEGMENTS
.rbenv
, rvm
and asdf
.Alternatively (and perhaps preferably), find out which tool is overriding Ruby version for you and remove the override if you no longer need it.
To show only last n significant path segments, you can set following in your config .zshrc
, e.g n=1 means show only last folder in present working directory:
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
See https://stackoverflow.com/a/49027654
The question/exclamation mark in Git segment (vcs segment, next to path) means the number of files untracked (?
) and unstaged (!
). For detailed description see What do different symbols in Git status mean?
You can change the version segment (on the right of prompt) to reflect another tool. For example to replace shown ruby version by python version replace the element within right promt elements in your config .zshrc
:
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(rbenv)
by
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(pyenv)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With