2019-10-25 01:08:09 +00:00
|
|
|
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>,
|
2019-10-28 13:41:16 +00:00
|
|
|
pub scan_timeout: u64,
|
2019-10-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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",
|
2019-10-25 01:08:09 +00:00
|
|
|
"kubernetes",
|
|
|
|
"directory",
|
|
|
|
"git_branch",
|
2019-12-06 16:57:42 +00:00
|
|
|
"git_commit",
|
2019-10-25 01:08:09 +00:00
|
|
|
"git_state",
|
|
|
|
"git_status",
|
2019-12-02 22:37:18 +00:00
|
|
|
"hg_branch",
|
2020-04-05 19:42:55 +00:00
|
|
|
"docker_context",
|
2019-10-25 01:08:09 +00:00
|
|
|
"package",
|
|
|
|
// ↓ Toolchain version modules ↓
|
|
|
|
// (Let's keep these sorted alphabetically)
|
|
|
|
"dotnet",
|
2020-03-02 03:29:27 +00:00
|
|
|
"elixir",
|
2020-02-06 03:57:04 +00:00
|
|
|
"elm",
|
2020-04-27 10:09:42 +00:00
|
|
|
"erlang",
|
2019-10-25 01:08:09 +00:00
|
|
|
"golang",
|
2020-02-01 22:16:10 +00:00
|
|
|
"haskell",
|
2019-10-25 01:08:09 +00:00
|
|
|
"java",
|
2020-04-03 18:16:34 +00:00
|
|
|
"julia",
|
2019-10-25 01:08:09 +00:00
|
|
|
"nodejs",
|
2020-05-21 16:43:13 +00:00
|
|
|
"ocaml",
|
2019-12-10 16:52:55 +00:00
|
|
|
"php",
|
2019-10-25 01:08:09 +00:00
|
|
|
"python",
|
|
|
|
"ruby",
|
|
|
|
"rust",
|
2019-12-09 01:42:51 +00:00
|
|
|
"terraform",
|
2020-05-21 16:49:49 +00:00
|
|
|
"zig",
|
2019-10-25 01:08:09 +00:00
|
|
|
// ↑ Toolchain version modules ↑
|
|
|
|
"nix_shell",
|
|
|
|
"conda",
|
|
|
|
"memory_usage",
|
|
|
|
"aws",
|
|
|
|
"env_var",
|
2020-04-24 17:37:34 +00:00
|
|
|
"crystal",
|
2019-10-25 01:08:09 +00:00
|
|
|
"cmd_duration",
|
2020-04-11 16:37:24 +00:00
|
|
|
"custom",
|
2019-10-25 01:08:09 +00:00
|
|
|
"line_break",
|
|
|
|
"jobs",
|
|
|
|
#[cfg(feature = "battery")]
|
|
|
|
"battery",
|
|
|
|
"time",
|
|
|
|
"character",
|
|
|
|
],
|
2019-10-28 13:41:16 +00:00
|
|
|
scan_timeout: 30,
|
2019-10-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|