diff options
author | Titouan Vervack <tivervac@gmail.com> | 2019-09-02 21:56:59 +0200 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-02 15:56:59 -0400 |
commit | 59e8b1fc927eff4874ea44e381953b86ffc8af7b (patch) | |
tree | 074535b48421d7d4ea2c148e751bb02e99e413f5 /docs | |
parent | f8929c2d7d37ef1a511ed2b941ca9b1644f666c7 (diff) |
feat: added truncation_length/symbol to git_branch (#268)
Git branches can become very long (e.g. gitlab auto-generated branch
names), thus it would be nice to be able to truncate them to keep your
prompt lenght in line.
This patch adds two new options to the git_branch module:
* truncation_length: The amount of graphemes to of a gitbranch to
truncate to
* truncation_symbol: The symbol that should be used to indicate that a
branch name was trunctated
To be able to correctly work with UTF-8 graphemes, unicode-segmentation
was added as a dependency.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/config/README.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/config/README.md b/docs/config/README.md index a91738d4a..732e1528d 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -211,10 +211,12 @@ The `git_branch` module shows the active branch of the repo in your current dire ### Options -| Variable | Default | Description | -| ---------- | ------- | ----------------------------------------------------------------------------- | -| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | -| `disabled` | `false` | Disables the `git_branch` module. | +| Variable | Default | Description | +| ------------------- | ---------- | ------------------------------------------------------------------------------------- | +| `symbol` | `" "` | The symbol used before the branch name of the repo in your current directory. | +| `disabled` | `false` | Disables the `git_branch` module. | +| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes | +| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use "" for no symbol | ### Example @@ -223,6 +225,8 @@ The `git_branch` module shows the active branch of the repo in your current dire [git_branch] symbol = "🌱 " +truncation_length = "4" +truncation_symbol = "" ``` ## Git Status |