1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-16 01:57:07 +00:00
starship/src/configs/starship_root.rs

67 lines
1.9 KiB
Rust
Raw Normal View History

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct StarshipRootConfig<'a> {
pub add_newline: bool,
pub prompt_order: Vec<&'a str>,
pub scan_timeout: u64,
}
impl<'a> RootModuleConfig<'a> for StarshipRootConfig<'a> {
fn new() -> Self {
StarshipRootConfig {
add_newline: true,
// List of default prompt order
// NOTE: If this const value is changed then Default prompt order subheading inside
// prompt heading of config docs needs to be updated according to changes made here.
prompt_order: vec![
"username",
"hostname",
2020-02-26 16:18:19 +00:00
"singularity",
"kubernetes",
"directory",
"git_branch",
2019-12-06 16:57:42 +00:00
"git_commit",
"git_state",
"git_status",
2019-12-02 22:37:18 +00:00
"hg_branch",
"docker_context",
"package",
// ↓ Toolchain version modules ↓
// (Let's keep these sorted alphabetically)
"dotnet",
2020-03-02 03:29:27 +00:00
"elixir",
"elm",
"golang",
"haskell",
"java",
"julia",
"nodejs",
"php",
"python",
"ruby",
"rust",
"terraform",
// ↑ Toolchain version modules ↑
"nix_shell",
"conda",
"memory_usage",
"aws",
"env_var",
"crystal",
"cmd_duration",
2020-04-11 16:37:24 +00:00
"custom",
"line_break",
"jobs",
#[cfg(feature = "battery")]
"battery",
"time",
"character",
],
scan_timeout: 30,
}
}
}