tweak default config to amplify theme-ability (#4572)

* tweak default config to amplify theme-ability

* missed default of auto
This commit is contained in:
Darren Schroeder 2022-02-20 16:05:36 -06:00 committed by GitHub
parent fd22211737
commit 9b2a022f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 22 deletions

View File

@ -185,7 +185,7 @@ pub fn get_color_config(config: &Config) -> HashMap<String, Style> {
// hm.insert("primitive_line".to_string(), Color::White.normal());
// hm.insert("primitive_pattern".to_string(), Color::White.normal());
// hm.insert("primitive_path".to_string(), Color::White.normal());
// hm.insert("separator_color".to_string(), Color::White.normal());
hm.insert("separator".to_string(), Color::White.normal());
hm.insert(
"leading_trailing_space_bg".to_string(),
Style::default().on(Color::Rgb(128, 128, 128)),
@ -292,14 +292,6 @@ pub fn style_primitive(primitive: &str, color_hm: &HashMap<String, Style>) -> Te
}
}
"record" | "list" | "block" => {
let style = color_hm.get(primitive);
match style {
Some(s) => TextStyle::with_style(Alignment::Left, *s),
None => TextStyle::basic_left(),
}
}
"nothing" => {
let style = color_hm.get(primitive);
match style {
@ -337,6 +329,14 @@ pub fn style_primitive(primitive: &str, color_hm: &HashMap<String, Style>) -> Te
}
}
"record" | "list" | "block" => {
let style = color_hm.get(primitive);
match style {
Some(s) => TextStyle::with_style(Alignment::Left, *s),
None => TextStyle::basic_left(),
}
}
// types in nushell but not in engine-q
// "Line" => {
// let style = color_hm.get("Primitive::Line");

View File

@ -107,32 +107,66 @@ extern "git push" [
--ipv6(-6) # use IPv6 addresses only
]
# The default config record. This is where much of your global configuration is setup.
let $config = {
filesize_metric: $false
table_mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
use_ls_colors: $true
rm_always_trash: $false
color_config: {
# for more information on themes see
# https://github.com/nushell/nushell/blob/main/docs/How_To_Coloring_and_Theming.md
let default_theme = {
# color for nushell primitives
separator: white
leading_trailing_space_bg: white
header: green_bold
date: white
filesize: white
row_index: green_bold
hints: dark_gray
empty: blue
bool: white
int: white
filesize: white
duration: white
date: white
range: white
float: white
string: white
nothing: white
binary: white
cellpath: white
}
row_index: green_bold
record: white
list: white
block: white
hints: dark_gray
# flatshapes are used to change the cli syntax highlighting
flatshape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
flatshape_bool: light_cyan
flatshape_int: purple_bold
flatshape_float: purple_bold
flatshape_range: yellow_bold
flatshape_internalcall: cyna_bold
flatshape_external: cyan
flatshape_externalarg: green_bold
flatshape_literal: blue
flatshape_operator: yellow
flatshape_signature: green_bold
flatshape_string: green
flatshape_string_interpolation: cyan_bold
flatshape_list: cyan_bold
flatshape_table: blue_bold
flatshape_record: cyan_bold
flatshape_block: blue_bold
flatshape_filepath: cyan
flatshape_globpattern: cyan_bold
flatshape_variable: purple
flatshape_flag: blue_bold
flatshape_custom: green
flatshape_nothing: light_cyan
}
# The default config record. This is where much of your global configuration is setup.
let $config = {
filesize_metric: $false
table_mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
use_ls_colors: $true
rm_always_trash: $false
color_config: $default_theme
use_grid_icons: $true
footer_mode: "30" # always, never, number_of_rows, auto
footer_mode: "25" # always, never, number_of_rows, auto
quick_completions: $true # set this to $false to prevent auto-selecting completions when only one remains
animate_prompt: $false # redraw the prompt every second
float_precision: 2