feat(kotlin): Add the kotlin module (#2026)

Add a module to show the currently installed Kotlin version if a
.kt/.kts file is found in the current folder
This commit is contained in:
Nicola Corti
2020-12-26 15:26:50 +01:00
committed by GitHub
parent 53a08712eb
commit 208251adef
8 changed files with 257 additions and 0 deletions
+45
View File
@@ -206,6 +206,7 @@ $golang\
$helm\
$java\
$julia\
$kotlin\
$nim\
$nodejs\
$ocaml\
@@ -1442,6 +1443,50 @@ The module will be shown if any of the following conditions are met:
symbol = "∴ "
```
## Kotlin
The `kotlin` module shows the currently installed version of Kotlin.
The module will be shown if any of the following conditions are met:
- The current directory contains a `.kt` or a `.kts` file
### Options
| Option | Default | Description |
| --------------- | ---------------------------------- | ----------------------------------------------------------------------------- |
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
| `symbol` | `"🅺 "` | A format string representing the symbol of Kotlin. |
| `style` | `"bold blue"` | The style for the module. |
| `kotlin_binary` | `"kotlin"` | Configures the kotlin binary that Starship executes when getting the version. |
| `disabled` | `false` | Disables the `kotlin` module. |
### Variables
| Variable | Example | Description |
| -------- | --------- | ------------------------------------ |
| version | `v1.4.21` | The version of `kotlin` |
| 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
### Example
```toml
# ~/.config/starship.toml
[kotlin]
symbol = "🅺 "
```
```toml
# ~/.config/starship.toml
[kotlin]
# Uses the Kotlin Compiler binary to get the installed version
kotlin_binary = "kotlinc"
```
## Kubernetes
Displays the current Kubernetes context name and, if set, the namespace from the kubeconfig file.