feat(nim): Configure when the module is shown (#2347)

This makes it possible to configure when the nim module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
This commit is contained in:
Shu Kutsuzawa
2021-02-21 21:21:20 +09:00
committed by GitHub
parent 873a005c42
commit 4651060999
3 changed files with 21 additions and 16 deletions
+10 -7
View File
@@ -1708,7 +1708,7 @@ truncation_symbol = ""
## Nim
The `nim` module shows the currently installed version of Nim.
The module will be shown if any of the following conditions are met:
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `nim.cfg` file
- The current directory contains a file with the `.nim` extension
@@ -1717,12 +1717,15 @@ The module will be shown if any of the following conditions are met:
### Options
| Option | Default | Description |
| ---------- | ---------------------------------- | ----------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `nim` module. |
| Option | Default | Description |
| -------------------- | ------------------------------------ | ----------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module |
| `symbol` | `"👑 "` | The symbol used before displaying the version of Nim. |
| `detect_extensions` | `["nim", "nims", "nimble"]` | Which extensions should trigger this moudle. |
| `detect_files` | `["nim.cfg"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `nim` module. |
### Variables