summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDario Vladović <d.vladimyr@gmail.com>2021-04-02 19:21:48 +0200
committerGitHub <noreply@github.com>2021-04-02 19:21:48 +0200
commitdbb68857242b04549e7cc5be6c30b918ab314f92 (patch)
tree733a2261751e71d00171249c1b483571b8a340a3 /docs
parent7779ed60753dff4b83219fe77d0e97b19d3b9fc4 (diff)
feat(ocaml): add `switch_indicator` and `switch_name` variable (#2503)
* feat(ocaml): add switch variable * feat(ocaml): configurable opam switch display * docs(ocaml): document opam switch display options Add `global_switch_indicator` and `local_switch_indicator` config options. * style(opam): add `OpamSwitch` type alias * fix(opam): gracefully handle empty opam switch Co-authored-by: cdaringe <cdaringe@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/config/README.md32
1 files changed, 18 insertions, 14 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index f7b8bef42..bb40af9fa 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -1865,23 +1865,27 @@ By default the module will be shown if any of the following conditions are met:
### Options
-| Option | Default | Description |
-| ------------------- | ------------------------------------ | ------------------------------------------------------- |
-| `format` | `"via [$symbol($version )]($style)"` | The format string for the module. |
-| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. |
-| `detect_extensions` | `["opam", "ml", "mli", "re", "rei"]` | Which extensions should trigger this module. |
-| `detect_files` | `["dune", "dune-project", "jbuild", "jbuild-ignore", ".merlin"]` | Which filenames should trigger this module. |
-| `detect_folders` | `["_opam", "esy.lock"]` | Which folders should trigger this module. |
-| `style` | `"bold yellow"` | The style for the module. |
-| `disabled` | `false` | Disables the `ocaml` module. |
+| Option | Default | Description |
+| ------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------- |
+| `format` | `"via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)"` | The format string for the module. |
+| `symbol` | `"🐫 "` | The symbol used before displaying the version of OCaml. |
+| `global_switch_indicator` | `""` | The format string used to represent global OPAM switch. |
+| `local_switch_indicator` | `"*"` | The format string used to represent local OPAM switch. |
+| `detect_extensions` | `["opam", "ml", "mli", "re", "rei"]` | Which extensions should trigger this module. |
+| `detect_files` | `["dune", "dune-project", "jbuild", "jbuild-ignore", ".merlin"]` | Which filenames should trigger this module. |
+| `detect_folders` | `["_opam", "esy.lock"]` | Which folders should trigger this module. |
+| `style` | `"bold yellow"` | The style for the module. |
+| `disabled` | `false` | Disables the `ocaml` module. |
### Variables
-| Variable | Example | Description |
-| -------- | --------- | ------------------------------------ |
-| version | `v4.10.0` | The version of `ocaml` |
-| symbol | | Mirrors the value of option `symbol` |
-| style\* | | Mirrors the value of option `style` |
+| Variable | Example | Description |
+| ---------------- | ------------ | ----------------------------------------------------------------- |
+| version | `v4.10.0` | The version of `ocaml` |
+| switch_name | `my-project` | The active OPAM switch |
+| switch_indicator | | Mirrors the value of `indicator` for currently active OPAM switch |
+| symbol | | Mirrors the value of option `symbol` |
+| style\* | | Mirrors the value of option `style` |
\*: This variable can only be used as a part of a style string