Limit git prompt branch name width in oh-my-zsh

2

I use long descriptive branch names in git, causing the prompt to take up too much space leaving less room for long paths.

I would like to limit the git plugin's branch segment to something like 15 characters which will be enough for me to keep track of which branch I'm on without showing the full branch name. Is this possible? I'm using oh-my-zsh.

Matthew

Posted 2017-06-27T14:49:34.763

Reputation: 966

Answers

1

There is a set of options in powerlevel9k:

POWERLEVEL9K_VCS_SHORTEN_LENGTH=4
POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH=11
POWERLEVEL9K_VCS_SHORTEN_STRATEGY="truncate_from_right"
POWERLEVEL9K_VCS_SHORTEN_DELIMITER=".."

Read more at https://github.com/bhilburn/powerlevel9k#vcs-truncation

5n00py

Posted 2017-06-27T14:49:34.763

Reputation: 26

Can you please tell more about what those options mean? – CaldeiraG – 2019-06-14T09:17:17.437

Awesome, this was added a little over a year after I asked this question. Nice to see this feature added. https://github.com/bhilburn/powerlevel9k/commit/111d152d48cc92229cb523a992a0ecee740381e7

– Matthew – 2019-06-14T17:11:59.820