feat(vlang): create module (#2577)

* Add V module

* Format

* Fix tests

* fix typo

* Update src/configs/v.rs

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Use blue bold

* v -> vlang

* change docs

* More vlang fixes

* add package support for v

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* use regex

* Update src/configs/mod.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* apply patch

* fix

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
Milo
2021-05-03 20:50:29 +01:00
committed by GitHub
parent dead06ba14
commit 48f913ec23
9 changed files with 194 additions and 0 deletions
+37
View File
@@ -223,6 +223,7 @@ $rust\
$scala\
$swift\
$terraform\
$vlang\
$vagrant\
$zig\
$nix_shell\
@@ -2022,6 +2023,7 @@ package, and shows its current version. The module currently supports `npm`, `ca
- [**helm**](https://helm.sh/docs/helm/helm_package/) - The `helm` chart version is extracted from the `Chart.yaml` present
- [**maven**](https://maven.apache.org/) - The `maven` package version is extracted from the `pom.xml` present
- [**meson**](https://mesonbuild.com/) - The `meson` package version is extracted from the `meson.build` present
- [**vlang**](https://vlang.io) - The `vlang` package version is extracted from the `v.mod` present
> ⚠️ The version being shown is that of the package whose source code is in your
> current directory, not your package manager.
@@ -2839,6 +2841,41 @@ By default the module will be shown if any of the following conditions are met:
format = "via [⍱ $version](bold white) "
```
## VLang
The `vlang` module shows you your currently installed version of V.
By default the module will be shown if any of the following conditions are met:
- The current directory contains a file with `.v` extension
- The current directory contains a `v.mod` file
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------------------- | ----------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `symbol` | `"V "` | A format string representing the symbol of V |
| `detect_extensions` | `["v"]` | Which extensions should trigger this module. |
| `detect_files` | `["v.mod"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"blue bold"` | The style for the module. |
| `disabled` | `false` | Disables the `vlang` module. |
### Variables
| Variable | Example | Description |
| -------- | -------- | ------------------------------------ |
| version | `v0.2` | The version of `v` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
### Example
```toml
# ~/.config/starship.toml
[v]
format = "via [V $version](blue bold) "
```
## VCSH
The `vcsh` module displays the current active [VCSH](https://github.com/RichiH/vcsh) repository.