summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlexander Gonzalez <alexfertel97@gmail.com>2021-07-10 16:54:34 -0400
committerGitHub <noreply@github.com>2021-07-10 16:54:34 -0400
commit9f337d15e7efb6010066088d7f0a611a6ecb5d79 (patch)
treed8d32c63272997a81244151e430381930d89a857 /docs
parent9126d78d0e102b925fce1dabd0b6f837e4e055e1 (diff)
feat: Add the `git_metrics` module (#2827)
This PR adds a new module named git_metrics. It shows the added/deleted lines in the current git repository following the format: "[+$added_lines]($added_style) [-$deleted_lines]($deleted_style)".
Diffstat (limited to 'docs')
-rw-r--r--docs/config/README.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index b7d62422f..2f4c3f379 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -194,6 +194,7 @@ $vcsh\
$git_branch\
$git_commit\
$git_state\
+$git_metrics\
$git_status\
$hg_branch\
$docker_context\
@@ -1232,6 +1233,48 @@ format = '[\($state( $progress_current of $progress_total)\)]($style) '
cherry_pick = "[🍒 PICKING](bold red)"
```
+## Git Metrics
+
+The `git_metrics` module will show the number of added and deleted lines in
+the current git repository.
+
+::: tip
+
+This module is disabled by default.
+To enable it, set `disabled` to `false` in your configuration file.
+
+:::
+
+### Options
+
+| Option | Default | Description |
+| ------------------------- | -------------------------------------------------------------------- | ---------------------------------------|
+| `added_style` | `"bold green"` | The style for the added count. |
+| `deleted_style` | `"bold red"` | The style for the deleted count. |
+| `format` | `'[+$added]($added_style) [-$deleted]($deleted_style) '` | The format for the module. |
+| `disabled` | `true` | Disables the `git_metrics` module. |
+
+### Variables
+
+| Variable | Example | Description |
+| ---------------- | ---------- | ----------------------------------- |
+| added | `1` | The current number of added lines |
+| deleted | `2` | The current number of deleted lines |
+| added_style\* | | Mirrors the value of option `added_style` |
+| deleted_style\* | | Mirrors the value of option `deleted_style` |
+
+\*: This variable can only be used as a part of a style string
+
+### Example
+
+```toml
+# ~/.config/starship.toml
+
+[git_metrics]
+added_style = "bold blue"
+format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
+```
+
## Git Status
The `git_status` module shows symbols representing the state of the repo in your