feat: Add configuration for add_newline (#116)

- Replace TableExt with a Config trait that extends toml::value::Table
Add configuration for add_newline
- add_newline is a root-level configuration value. When set to false, the initial newline before the prompt is removed.
This commit is contained in:
Matan Kushner
2019-07-27 18:25:13 -04:00
committed by GitHub
parent 95ce43ee70
commit 0bc28c521d
7 changed files with 73 additions and 28 deletions
+21
View File
@@ -14,6 +14,9 @@ $ touch ~/.config/starship.toml
All configuration for starship is done in this [TOML](https://github.com/toml-lang/toml) file:
```toml
# Don't print a new line at the start of the prompt
add_newline = false
# Replace the "➜" symbol in the prompt with ""
[character] # The name of the module we are confguring is "character"
symbol = "" # The "symbol" segment is being set to ""
@@ -37,6 +40,24 @@ are segments within it. Every module also has a prefix and suffix that are the d
"via " "⬢" "v10.4.1" ""
```
## Prompt
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 |
### Example
```toml
# ~/.config/starship.toml
# Disable the newline at the start of the prompt
add_newline = false
```
## Battery
The `battery` module shows how charged the device's battery is and its current charging status.