1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-27 03:53:30 +00:00
starship/src/configs/starship_root.rs
Daniel A. White 0be9ffc0a1
feat(shlvl): Add shlvl module (#1385)
* initial commit of support for shlvl

* documentation for shlvl

* use a symbol instead

* test coverage for shlvl

* actually disable when the config says to

* fix docs

* tweak defaults some

* refactor from pr comments

* redisable

* return early to avoid indenting

* make default suffix empty space

* fixing tests after suffix change

* updating docs for format

* making shlvl compatible with formatting

* adding variables table for shlvl

* removing extra line

* doc clarity
2020-08-05 18:30:01 +02:00

78 lines
1.5 KiB
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct StarshipRootConfig<'a> {
pub format: &'a str,
pub scan_timeout: u64,
}
// 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",
"shlvl",
"singularity",
"kubernetes",
"directory",
"git_branch",
"git_commit",
"git_state",
"git_status",
"hg_branch",
"docker_context",
"package",
// ↓ Toolchain version modules ↓
// (Let's keep these sorted alphabetically)
"cmake",
"dart",
"dotnet",
"elixir",
"elm",
"erlang",
"golang",
"helm",
"java",
"julia",
"nim",
"nodejs",
"ocaml",
"perl",
"php",
"purescript",
"python",
"ruby",
"rust",
"swift",
"terraform",
"zig",
// ↑ Toolchain version modules ↑
"nix_shell",
"conda",
"memory_usage",
"aws",
"gcloud",
"env_var",
"crystal",
"cmd_duration",
"custom",
"line_break",
"jobs",
#[cfg(feature = "battery")]
"battery",
"time",
"character",
];
impl<'a> RootModuleConfig<'a> for StarshipRootConfig<'a> {
fn new() -> Self {
StarshipRootConfig {
format: "\n$all",
scan_timeout: 30,
}
}
}