Reputation: 1519
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?
Upvotes: 29
Views: 49071
Reputation: 2718
~/.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.
Upvotes: 71
Reputation: 9418
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)
Upvotes: 13