mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat(lua): Add a Lua module (#1815)
* feat: add lua module * docs: add lua module * fix: lua version test * feat: lua module can be detected if the current dir contains a "lua" dir * feat: enable to use luajit * fix: improve regex * fix based on https://github.com/starship/starship/pull/1815#discussion_r510932742 * fix based on https://github.com/starship/starship/pull/1815#discussion_r511362581 * fix based on https://github.com/starship/starship/pull/1815#discussion_r510941252
This commit is contained in:
@@ -229,6 +229,7 @@ $crystal\
|
||||
$cmd_duration\
|
||||
$custom\
|
||||
$line_break\
|
||||
$lua\
|
||||
$jobs\
|
||||
$battery\
|
||||
$time\
|
||||
@@ -1494,6 +1495,44 @@ The `line_break` module separates the prompt into two lines.
|
||||
disabled = true
|
||||
```
|
||||
|
||||
## Lua
|
||||
|
||||
The `lua` module shows the currently installed version of Lua.
|
||||
The module will be shown if any of the following conditions are met:
|
||||
|
||||
- The current directory contains a `.lua-version` file
|
||||
- The current directory contains a `lua` directory
|
||||
- The current directory contains a file with the `.lua` extension
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Default | Description |
|
||||
| ------------ | ---------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| `format` | `"via [$symbol$version]($style) "` | The format for the module. |
|
||||
| `symbol` | `"🌙 "` | A format string representing the symbol of Lua. |
|
||||
| `style` | `"bold blue"` | The style for the module. |
|
||||
| `lua_binary` | `"lua"` | Configures the lua binary that Starship executes when getting the version. |
|
||||
| `disabled` | `false` | Disables the `lua` module. |
|
||||
|
||||
### Variables
|
||||
|
||||
| Variable | Example | Description |
|
||||
| -------- | --------- | ------------------------------------ |
|
||||
| version | `v5.4.0` | The version of `lua` |
|
||||
| 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
|
||||
|
||||
[lua]
|
||||
format = "via [🌕 $version](bold blue) "
|
||||
```
|
||||
|
||||
## Memory Usage
|
||||
|
||||
The `memory_usage` module shows current system memory and swap usage.
|
||||
|
||||
Reference in New Issue
Block a user