1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-08-01 20:47:48 +00:00

Set color vals to be colored

This commit is contained in:
RGBCube 2023-12-03 13:14:22 +03:00
parent 89a136ca4a
commit e167c519df
No known key found for this signature in database

View file

@ -1,417 +1,415 @@
$env.config = { $env.config = {
bracketed_paste: true bracketed_paste: true
buffer_editor: "" buffer_editor: ""
datetime_format: {} datetime_format: {}
edit_mode: vi edit_mode: vi
error_style: fancy error_style: fancy
float_precision: 2 float_precision: 2
footer_mode: 25 footer_mode: 25
render_right_prompt_on_last_line: false render_right_prompt_on_last_line: false
shell_integration: false shell_integration: false
show_banner: false show_banner: false
use_ansi_coloring: true use_ansi_coloring: true
use_grid_icons: true use_grid_icons: true
use_kitty_protocol: false use_kitty_protocol: false
} }
$env.config.color_config = { $env.config.color_config = {
binary: white binary: white
block: white block: white
bool: {|| if $in { "light_cyan" } else { "light_red" }} bool: {|| if $in { "light_green" } else { "light_red" } }
cell-path: white cell-path: white
date: purple date: purple
duration: white duration: white
empty: blue empty: blue
filesize: cyan filesize: cyan
float: white float: white
header: green_bold header: green_bold
hints: dark_gray hints: dark_gray
int: white int: white
leading_trailing_space_bg: { attr: n } list: white
list: white nothing: white
nothing: white range: white
range: white record: white
record: white row_index: green_bold
row_index: green_bold search_result: { bg: red fg: white }
search_result: { bg: red fg: white } separator: white
separator: white string: {|| if $in =~ "^(#|0x)[a-fA-F0-9]+$" { ($in | str replace "0x" "#") } else { "white" } }
string: white leading_trailing_space_bg: { attr: n }
shape_and: purple_bold shape_and: purple_bold
shape_binary: purple_bold shape_binary: purple_bold
shape_block: blue_bold shape_block: blue_bold
shape_bool: light_cyan shape_bool: light_cyan
shape_closure: green_bold shape_closure: green_bold
shape_custom: green shape_custom: green
shape_datetime: cyan_bold shape_datetime: cyan_bold
shape_directory: cyan shape_directory: cyan
shape_external: cyan shape_external: cyan
shape_externalarg: green_bold shape_externalarg: green_bold
shape_filepath: cyan shape_filepath: cyan
shape_flag: blue_bold shape_flag: blue_bold
shape_float: purple_bold shape_float: purple_bold
shape_garbage: { fg: white bg: red attr: b} shape_garbage: { fg: white bg: red attr: b}
shape_globpattern: cyan_bold shape_globpattern: cyan_bold
shape_int: purple_bold shape_int: purple_bold
shape_internalcall: cyan_bold shape_internalcall: cyan_bold
shape_list: cyan_bold shape_list: cyan_bold
shape_literal: blue shape_literal: blue
shape_match_pattern: green shape_match_pattern: green
shape_matching_brackets: { attr: u } shape_nothing: light_cyan
shape_nothing: light_cyan shape_operator: yellow
shape_operator: yellow shape_or: purple_bold
shape_or: purple_bold shape_pipe: purple_bold
shape_pipe: purple_bold shape_range: yellow_bold
shape_range: yellow_bold shape_record: cyan_bold
shape_record: cyan_bold shape_redirection: purple_bold
shape_redirection: purple_bold shape_signature: green_bold
shape_signature: green_bold shape_string: green
shape_string: green shape_table: blue_bold
shape_string_interpolation: cyan_bold shape_vardecl: purple
shape_table: blue_bold shape_variable: purple
shape_vardecl: purple shape_matching_brackets: { attr: u }
shape_variable: purple shape_string_interpolation: cyan_bold
} }
$env.config.ls = { $env.config.ls = {
clickable_links: true clickable_links: true
use_ls_colors: true use_ls_colors: true
} }
$env.config.rm = { $env.config.rm.always_trash = false
always_trash: false
}
$env.config.table = { $env.config.table = {
header_on_separator: false header_on_separator: false
index_mode: always index_mode: always
mode: rounded mode: rounded
padding: { left: 1, right: 1 } padding: { left: 1 right: 1 }
show_empty: true show_empty: true
trim: { trim: {
methodology: wrapping methodology: wrapping
wrapping_try_keep_words: true wrapping_try_keep_words: true
truncating_suffix: "..." truncating_suffix: "..."
} }
} }
$env.config.explore = { $env.config.explore = {
command_bar_text: { fg: "#C4C9C6" } command_bar_text: { fg: "#C4C9C6" }
highlight: { fg: black, bg: yellow } highlight: { fg: black bg: yellow }
status: { status: {
error: { fg: white, bg: red } error: { fg: white bg: red }
warn: {} warn: {}
info: {} info: {}
} }
status_bar_background: { fg: "#1D1F21", bg: "#C4C9C6" } status_bar_background: { fg: "#1D1F21" bg: "#C4C9C6" }
table: { table: {
split_line: { fg: "#404040" } split_line: { fg: "#404040" }
selected_cell: { bg: light_blue } selected_cell: { bg: light_blue }
selected_row: {} selected_row: {}
selected_column: {} selected_column: {}
} }
} }
$env.config.history = { $env.config.history = {
file_format: plaintext file_format: plaintext
isolation: false isolation: false
max_size: 100_000 max_size: 100_000
sync_on_enter: true sync_on_enter: true
} }
$env.config.completions = { $env.config.completions = {
algorithm: fuzzy algorithm: fuzzy
case_sensitive: false case_sensitive: false
partial: true partial: true
quick: true quick: true
external: { external: {
enable: true enable: true
max_results: 100 max_results: 100
completer: {|tokens: list<string>| completer: {|tokens: list<string>|
let expanded_alias = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0 let expanded_alias = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
let tokens = if $expanded_alias != null { let tokens = if $expanded_alias != null {
$expanded_alias | split row " " | append ($tokens | skip 1) $expanded_alias | split row " " | append ($tokens | skip 1)
} else { } else {
$tokens $tokens
} }
let command = $tokens.0 | str trim --left --char "^" let command = $tokens.0 | str trim --left --char "^"
let completions = carapace $command nushell $tokens | from json | default [] let completions = carapace $command nushell $tokens | from json | default []
if ($completions | is-empty) { if ($completions | is-empty) {
let path = $tokens | last let path = $tokens | last
ls $"($path)*" | each {|it| ls $"($path)*" | each {|it|
let choice = if ($path | str ends-with "/") { let choice = if ($path | str ends-with "/") {
$path | path join ($it.name | path basename) $path | path join ($it.name | path basename)
} else { } else {
$path | path dirname | path join ($it.name | path basename) $path | path dirname | path join ($it.name | path basename)
} }
let choice = if ($it.type == "dir") and (not ($choice | str ends-with "/")) { let choice = if ($it.type == "dir") and (not ($choice | str ends-with "/")) {
$"($choice)/" $"($choice)/"
} else { } else {
$choice $choice
} }
if ($choice | str contains " ") { if ($choice | str contains " ") {
$"`($choice)`" $"`($choice)`"
} else { } else {
$choice $choice
} }
}
} else if ($completions | where value =~ "^.*ERR$" | is-empty) {
$completions
} else {
null
}
} }
} else if ($completions | where value =~ "^.*ERR$" | is-empty) {
$completions
} else {
null
}
} }
}
} }
$env.config.filesize = { $env.config.filesize = {
format: auto format: auto
metric: true metric: true
} }
$env.config.cursor_shape = { $env.config.cursor_shape = {
vi_insert: line vi_insert: line
vi_normal: block vi_normal: block
} }
$env.config.hooks = { $env.config.hooks = {
command_not_found: {} command_not_found: {}
display_output: "if (term size).columns >= 100 { table --expand } else { table }" display_output: "if (term size).columns >= 100 { table --expand } else { table }"
env_change: {} env_change: {}
pre_execution: [ pre_execution: [
{ {
let prompt = (commandline) | str trim let prompt = (commandline) | str trim
if ($prompt | is-empty) { if ($prompt | is-empty) {
return return
} }
echo $"(ansi title)($prompt) — nu(char bel)" echo $"(ansi title)($prompt) — nu(char bel)"
} }
] ]
pre_prompt: [] pre_prompt: []
} }
$env.config.menus = [ $env.config.menus = [
{ {
marker: "| " marker: "| "
name: completion_menu name: completion_menu
only_buffer_difference: false only_buffer_difference: false
style: { style: {
description_text: yellow description_text: yellow
selected_text: green_reverse selected_text: green_reverse
text: green text: green
}
type: {
col_padding: 2
col_width: 20
columns: 4
layout: columnar
}
} }
{ type: {
marker: "? " col_padding: 2
name: history_menu col_width: 20
only_buffer_difference: true columns: 4
style: { layout: columnar
description_text: yellow
selected_text: green_reverse
text: green
}
type: {
layout: list
page_size: 10
}
} }
{ }
marker: "? " {
name: help_menu marker: "? "
only_buffer_difference: true name: history_menu
style: { only_buffer_difference: true
description_text: yellow style: {
selected_text: green_reverse description_text: yellow
text: green selected_text: green_reverse
} text: green
type: {
col_padding: 2
col_width: 20
columns: 4
description_rows: 10
layout: description
selection_rows: 4
}
} }
type: {
layout: list
page_size: 10
}
}
{
marker: "? "
name: help_menu
only_buffer_difference: true
style: {
description_text: yellow
selected_text: green_reverse
text: green
}
type: {
col_padding: 2
col_width: 20
columns: 4
description_rows: 10
layout: description
selection_rows: 4
}
}
] ]
$env.config.keybindings = [ $env.config.keybindings = [
{ {
name: completion_menu name: completion_menu
modifier: none modifier: none
keycode: tab keycode: tab
mode: [ vi_normal vi_insert ] mode: [ vi_normal vi_insert ]
event: { event: {
until: [ until: [
{ send: menu name: completion_menu } { send: menu name: completion_menu }
{ send: menunext } { send: menunext }
{ edit: complete } { edit: complete }
] ]
}
} }
{ }
name: history_menu {
modifier: control name: history_menu
keycode: char_h modifier: control
mode: [ vi_insert vi_normal ] keycode: char_h
event: { send: menu name: history_menu } mode: [ vi_insert vi_normal ]
event: { send: menu name: history_menu }
}
{
name: escape
modifier: none
keycode: escape
mode: [ vi_normal vi_insert ]
event: { send: esc }
}
{
name: cancel_command
modifier: control
keycode: char_c
mode: [ vi_normal vi_insert ]
event: { send: ctrlc }
}
{
name: quit_shell
modifier: control
keycode: char_d
mode: [ vi_normal vi_insert ]
event: { send: ctrld }
}
{
name: clear_screen
modifier: control
keycode: char_l
mode: [ vi_normal vi_insert ]
event: { send: clearscreen }
}
{
name: open_command_editor
modifier: control
keycode: char_o
mode: [ vi_normal vi_insert ]
event: { send: openeditor }
}
{
name: move_up
modifier: none
keycode: up
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: menuup }
{ send: up }
]
} }
{ }
name: escape {
modifier: none name: move_down
keycode: escape modifier: none
mode: [ vi_normal vi_insert ] keycode: down
event: { send: esc } mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: menudown }
{ send: down }
]
} }
{ }
name: cancel_command {
modifier: control name: move_left
keycode: char_c modifier: none
mode: [ vi_normal vi_insert ] keycode: left
event: { send: ctrlc } mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: menuleft }
{ send: left }
]
} }
{ }
name: quit_shell {
modifier: control name: move_right_or_take_history_hint
keycode: char_d modifier: none
mode: [ vi_normal vi_insert ] keycode: right
event: { send: ctrld } mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: historyhintcomplete }
{ send: menuright }
{ send: right }
]
} }
{ }
name: clear_screen {
modifier: control name: move_one_word_left
keycode: char_l modifier: control
mode: [ vi_normal vi_insert ] keycode: left
event: { send: clearscreen } mode: [ vi_normal vi_insert ]
event: { edit: movewordleft }
}
{
name: move_one_word_right_or_take_history_hint
modifier: control
keycode: right
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: historyhintwordcomplete }
{ edit: movewordright }
]
} }
{ }
name: open_command_editor {
modifier: control name: move_to_line_start
keycode: char_o modifier: control
mode: [ vi_normal vi_insert ] keycode: char_a
event: { send: openeditor } mode: [ vi_normal vi_insert ]
} event: { edit: movetolinestart }
{ }
name: move_up {
modifier: none name: move_to_line_end_or_take_history_hint
keycode: up modifier: control
mode: [ vi_normal vi_insert ] keycode: char_e
event: { mode: [ vi_normal vi_insert ]
until: [ event: {
{ send: menuup } until: [
{ send: up } { send: historyhintcomplete }
] { edit: movetolineend }
} ]
}
{
name: move_down
modifier: none
keycode: down
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: menudown }
{ send: down }
]
}
}
{
name: move_left
modifier: none
keycode: left
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: menuleft }
{ send: left }
]
}
}
{
name: move_right_or_take_history_hint
modifier: none
keycode: right
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: historyhintcomplete }
{ send: menuright }
{ send: right }
]
}
}
{
name: move_one_word_left
modifier: control
keycode: left
mode: [ vi_normal vi_insert ]
event: { edit: movewordleft }
}
{
name: move_one_word_right_or_take_history_hint
modifier: control
keycode: right
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: historyhintwordcomplete }
{ edit: movewordright }
]
}
}
{
name: move_to_line_start
modifier: control
keycode: char_a
mode: [ vi_normal vi_insert ]
event: { edit: movetolinestart }
}
{
name: move_to_line_end_or_take_history_hint
modifier: control
keycode: char_e
mode: [ vi_normal vi_insert ]
event: {
until: [
{ send: historyhintcomplete }
{ edit: movetolineend }
]
}
}
{
name: delete_one_character_backward
modifier: none
keycode: backspace
mode: vi_insert
event: { edit: backspace }
}
{
name: delete_one_word_backward
modifier: control
keycode: backspace
mode: vi_insert
event: { edit: backspaceword }
}
{
name: newline_or_run_command
modifier: none
keycode: enter
mode: vi_insert
event: { send: enter }
} }
}
{
name: delete_one_character_backward
modifier: none
keycode: backspace
mode: vi_insert
event: { edit: backspace }
}
{
name: delete_one_word_backward
modifier: control
keycode: backspace
mode: vi_insert
event: { edit: backspaceword }
}
{
name: newline_or_run_command
modifier: none
keycode: enter
mode: vi_insert
event: { send: enter }
}
] ]