mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-06-02 16:40:51 +00:00
3014284e95
* feat/add readme + presets * feat/add spack module * feat/add spack config * feat/spack to handle * feat/add spack to modules and root * fix/readme formattign * fix/readme typo * fix/readme formatting * feat/replace module_config_derive with serde * feat/add macros to generate schema + schema
113 lines
2.3 KiB
Rust
113 lines
2.3 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Serialize, Deserialize, Debug)]
|
|
#[cfg_attr(feature = "config-schema", derive(schemars::JsonSchema))]
|
|
#[serde(default)]
|
|
pub struct StarshipRootConfig {
|
|
#[serde(rename = "$schema")]
|
|
schema: String,
|
|
pub format: String,
|
|
pub right_format: String,
|
|
pub continuation_prompt: String,
|
|
pub scan_timeout: u64,
|
|
pub command_timeout: u64,
|
|
pub add_newline: bool,
|
|
}
|
|
|
|
// 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.
|
|
pub const PROMPT_ORDER: &[&str] = &[
|
|
"username",
|
|
"hostname",
|
|
"localip",
|
|
"shlvl",
|
|
"singularity",
|
|
"kubernetes",
|
|
"directory",
|
|
"vcsh",
|
|
"git_branch",
|
|
"git_commit",
|
|
"git_state",
|
|
"git_metrics",
|
|
"git_status",
|
|
"hg_branch",
|
|
"docker_context",
|
|
"package",
|
|
// ↓ Toolchain version modules ↓
|
|
// (Let's keep these sorted alphabetically)
|
|
"c",
|
|
"cmake",
|
|
"cobol",
|
|
"dart",
|
|
"deno",
|
|
"dotnet",
|
|
"elixir",
|
|
"elm",
|
|
"erlang",
|
|
"golang",
|
|
"haskell",
|
|
"helm",
|
|
"java",
|
|
"julia",
|
|
"kotlin",
|
|
"lua",
|
|
"nim",
|
|
"nodejs",
|
|
"ocaml",
|
|
"perl",
|
|
"php",
|
|
"pulumi",
|
|
"purescript",
|
|
"python",
|
|
"rlang",
|
|
"red",
|
|
"ruby",
|
|
"rust",
|
|
"scala",
|
|
"swift",
|
|
"terraform",
|
|
"vlang",
|
|
"vagrant",
|
|
"zig",
|
|
// ↑ Toolchain version modules ↑
|
|
"buf",
|
|
"nix_shell",
|
|
"conda",
|
|
"spack",
|
|
"memory_usage",
|
|
"aws",
|
|
"gcloud",
|
|
"openstack",
|
|
"azure",
|
|
"env_var",
|
|
"crystal",
|
|
"custom",
|
|
"sudo",
|
|
"cmd_duration",
|
|
"line_break",
|
|
"jobs",
|
|
#[cfg(feature = "battery")]
|
|
"battery",
|
|
"time",
|
|
"status",
|
|
"container",
|
|
"shell",
|
|
"character",
|
|
];
|
|
|
|
// On changes please also update `Default` for the `FullConfig` struct in `mod.rs`
|
|
impl<'a> Default for StarshipRootConfig {
|
|
fn default() -> Self {
|
|
StarshipRootConfig {
|
|
schema: "https://starship.rs/config-schema.json".to_string(),
|
|
format: "$all".to_string(),
|
|
right_format: "".to_string(),
|
|
continuation_prompt: "[∙](bright-black) ".to_string(),
|
|
scan_timeout: 30,
|
|
command_timeout: 500,
|
|
add_newline: true,
|
|
}
|
|
}
|
|
}
|