feat(shlvl): add repeat_offset for repeated symbol (#5289)

Signed-off-by: Vivek Kushwaha <yoursvivek@users.noreply.github.com>
This commit is contained in:
Vivek Kushwaha
2023-07-14 14:29:02 +05:30
committed by GitHub
parent c5edb413dd
commit 3402f0e82a
4 changed files with 73 additions and 9 deletions
+25 -8
View File
@@ -3772,14 +3772,15 @@ set to a number and meets or exceeds the specified threshold.
### Options
| Option | Default | Description |
| ----------- | ---------------------------- | ------------------------------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `'[$symbol$shlvl]($style) '` | The format for the module. |
| `symbol` | `'↕️ '` | The symbol used to represent the `SHLVL`. |
| `repeat` | `false` | Causes `symbol` to be repeated by the current `SHLVL` amount. |
| `style` | `'bold yellow'` | The style for the module. |
| `disabled` | `true` | Disables the `shlvl` module. |
| Option | Default | Description |
| --------------- | ---------------------------- | ------------------------------------------------------------------- |
| `threshold` | `2` | Display threshold. |
| `format` | `'[$symbol$shlvl]($style) '` | The format for the module. |
| `symbol` | `'↕️ '` | The symbol used to represent the `SHLVL`. |
| `repeat` | `false` | Causes `symbol` to be repeated by the current `SHLVL` amount. |
| `repeat_offset` | `0` | Decrements number of times `symbol` is repeated by the offset value |
| `style` | `'bold yellow'` | The style for the module. |
| `disabled` | `true` | Disables the `shlvl` module. |
### Variables
@@ -3802,6 +3803,22 @@ format = '$shlvl level(s) down'
threshold = 3
```
Using `repeat` and `repeat_offset` along with `character` module, one can get
prompt like `❯❯❯` where last character is colored appropriately for return
status code and preceeding characters are provided by `shlvl`.
```toml
# ~/.config/starship.toml
[shlvl]
disabled = false
format = '[$symbol$shlvl]($style)'
repeat = true
symbol = ''
repeat_offset = 1
threshold = 0
```
## Singularity
The `singularity` module shows the current [Singularity](https://sylabs.io/singularity/) image, if inside a container