diff options
author | Taras Shpachenko <taras.shpachenko@onapp.com> | 2018-04-12 13:39:39 +0300 |
---|---|---|
committer | Taras Shpachenko <taras.shpachenko@onapp.com> | 2018-04-12 18:11:23 +0300 |
commit | 111d152d48cc92229cb523a992a0ecee740381e7 (patch) | |
tree | 7d6f348319ce3c6819b8a398c4ddfafa1a0773bd /README.md | |
parent | 4c919f1a2bca9d52271edebcbd5090423304afef (diff) |
Add vcs branch name truncating.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -637,6 +637,29 @@ from the [Installation](#Installation) section above. | None | None | ![icon_git](https://cloud.githubusercontent.com/assets/1544760/7976092/b5909f80-0a76-11e5-9950-1438b9d72465.gif) | Repository is a git repository | None | None | ![icon_mercurial](https://cloud.githubusercontent.com/assets/1544760/7976090/b5908da6-0a76-11e5-8c91-452b6e73f631.gif) | Repository is a Mercurial repository +You can limit the branch name to a certain length by truncating long names. +Customizations available are: + +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_VCS_SHORTEN_LENGTH`|None|This field determines how many characters to show.| +|`POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH`|None|This field determines minimum branch length. Branch name will be truncated if its length greater than this field.| +|`POWERLEVEL9K_VCS_SHORTEN_STRATEGY`|None|This field determines how branch name should be truncated. See the table below for more information.| +|`POWERLEVEL9K_SHORTEN_DELIMITER`|`...`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.| + +| Strategy Name | Description | +|---------------|-------------| +|`truncate_middle`|Truncates the middle part of a branch. E.g. branch name is `1234-super_super_long_branch_name`, then it will truncated to `1234-..._name`, if `POWERLEVEL9K_VCS_SHORTEN_LENGTH=5` is also set (controls the amount of characters to be left).| +|`truncate_from_right`|Just leaves the beginning of a branch name untouched. E.g. branch name will be truncated like so: `1234-...`. How many characters will be untouched is controlled by `POWERLEVEL9K_VCS_SHORTEN_LENGTH`.| + +For example, if you want to truncate `1234-super_super_long_branch_name` to `1234-..` and don't do it with `development`: +```zsh +POWERLEVEL9K_VCS_SHORTEN_LENGTH=4 +POWERLEVEL9K_VCS_SHORTEN_MIN_LENGTH=11 +POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" +POWERLEVEL9K_VCS_SHORTEN_DELIMITER=".." +``` + ##### vi_mode This segment shows ZSH's current input mode. Note that this is only useful if |