mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
feat: Add configuration for reordering the prompt module and disabling default order (#171)
Adds functionality for reordering the prompt module through the use of the prompt_order configuration option in starship.toml
This commit is contained in:
committed by
Kevin Song
parent
51f723df22
commit
f54322f2ab
+28
-3
@@ -46,9 +46,10 @@ This is the list of prompt-wide configuration options.
|
||||
|
||||
### Options
|
||||
|
||||
| Variable | Default | Description |
|
||||
| ------------- | ------- | ---------------------------------------------- |
|
||||
| `add_newline` | `true` | Add a new line before the start of the prompt. |
|
||||
| Variable | Default | Description |
|
||||
| -------------- | ------- | ------------------------------------------------------------------ |
|
||||
| `add_newline` | `true` | Add a new line before the start of the prompt. |
|
||||
| `prompt_order` | [link](#default-prompt-order) | Configure the order in which the prompt module occurs. |
|
||||
|
||||
### Example
|
||||
|
||||
@@ -57,8 +58,32 @@ This is the list of prompt-wide configuration options.
|
||||
|
||||
# Disable the newline at the start of the prompt
|
||||
add_newline = false
|
||||
# Overwrite a default_prompt_order and use custom prompt_order
|
||||
prompt_order=["rust","line_break","package","line_break","character"]
|
||||
```
|
||||
|
||||
### Default prompt order
|
||||
The ```default_prompt_order``` configuration option is used to define the order in which modules are shown in the prompt, if empty or no ```prompt_order``` is provided. The default is as shown:
|
||||
```
|
||||
default_prompt_order = [
|
||||
"username",
|
||||
"directory",
|
||||
"git_branch",
|
||||
"git_status",
|
||||
"package",
|
||||
"nodejs",
|
||||
"rust",
|
||||
"python",
|
||||
"golang",
|
||||
"cmd_duration",
|
||||
"line_break",
|
||||
"jobs",
|
||||
"battery",
|
||||
"character",
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
## Battery
|
||||
|
||||
The `battery` module shows how charged the device's battery is and its current charging status.
|
||||
|
||||
Reference in New Issue
Block a user