nushell changes

This commit is contained in:
Tao Tien 2024-02-08 09:07:51 -08:00
parent 522155b556
commit b572285863
2 changed files with 5 additions and 92 deletions

View file

@ -90,89 +90,6 @@ let dark_theme = {
shape_vardecl: purple shape_vardecl: purple
} }
let light_theme = {
# color for nushell primitives
separator: dark_gray
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
header: green_bold
empty: blue
# Closures can be used to choose colors for specific values.
# The value (in this case, a bool) is piped into the closure.
bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
int: dark_gray
filesize: {|e|
if $e == 0b {
'dark_gray'
} else if $e < 1mb {
'cyan_bold'
} else { 'blue_bold' }
}
duration: dark_gray
date: {|| (date now) - $in |
if $in < 1hr {
'purple'
} else if $in < 6hr {
'red'
} else if $in < 1day {
'yellow'
} else if $in < 3day {
'green'
} else if $in < 1wk {
'light_green'
} else if $in < 6wk {
'cyan'
} else if $in < 52wk {
'blue'
} else { 'dark_gray' }
}
range: dark_gray
float: dark_gray
string: dark_gray
nothing: dark_gray
binary: dark_gray
cellpath: dark_gray
row_index: green_bold
record: white
list: white
block: white
hints: dark_gray
search_result: {fg: white bg: red}
shape_and: purple_bold
shape_binary: purple_bold
shape_block: blue_bold
shape_bool: light_cyan
shape_closure: green_bold
shape_custom: green
shape_datetime: cyan_bold
shape_directory: cyan
shape_external: cyan
shape_externalarg: green_bold
shape_filepath: cyan
shape_flag: blue_bold
shape_float: purple_bold
# shapes are used to change the cli syntax highlighting
shape_garbage: { fg: white bg: red attr: b}
shape_globpattern: cyan_bold
shape_int: purple_bold
shape_internalcall: cyan_bold
shape_list: cyan_bold
shape_literal: blue
shape_match_pattern: green
shape_matching_brackets: { attr: u }
shape_nothing: light_cyan
shape_operator: yellow
shape_or: purple_bold
shape_pipe: purple_bold
shape_range: yellow_bold
shape_record: cyan_bold
shape_redirection: purple_bold
shape_signature: green_bold
shape_string: green
shape_string_interpolation: cyan_bold
shape_table: blue_bold
shape_variable: purple
shape_vardecl: purple
}
# External completer example # External completer example
# let carapace_completer = {|spans| # let carapace_completer = {|spans|
@ -244,7 +161,7 @@ $env.config = {
history: { history: {
max_size: 100_000 # Session has to be reloaded for this to take effect max_size: 100_000 # Session has to be reloaded for this to take effect
sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file sync_on_enter: false # Enable to share history between multiple sessions, else you have to close the session to write history to file
file_format: "plaintext" # "sqlite" or "plaintext" file_format: "plaintext" # "sqlite" or "plaintext"
isolation: false # only available with sqlite file_format. true enables history isolation, false disables it. true will allow the history to be isolated to the current session using up/down arrows. false will allow the history to be shared across all sessions. isolation: false # only available with sqlite file_format. true enables history isolation, false disables it. true will allow the history to be isolated to the current session using up/down arrows. false will allow the history to be shared across all sessions.
} }
@ -253,7 +170,7 @@ $env.config = {
case_sensitive: false # set to true to enable case-sensitive completions case_sensitive: false # set to true to enable case-sensitive completions
quick: true # set this to false to prevent auto-selecting completions when only one remains quick: true # set this to false to prevent auto-selecting completions when only one remains
partial: true # set this to false to prevent partial filling of the prompt partial: true # set this to false to prevent partial filling of the prompt
algorithm: "prefix" # prefix or fuzzy algorithm: "fuzzy" # prefix or fuzzy
external: { external: {
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
@ -808,4 +725,4 @@ $env.config = {
source ~/.zoxide.nu source ~/.zoxide.nu
source ~/.cache/starship/init.nu source ~/.cache/starship/init.nu
alias zj = zellij alias zj = zellij

View file

@ -38,12 +38,8 @@
}; };
indent = { tab-width = 8; unit = "\t"; }; indent = { tab-width = 8; unit = "\t"; };
} }
{ { name = "html"; auto-format = false; indent = { tab-width = 4; unit = "\t"; }; }
name = "nix"; { name = "nix"; auto-format = true; formatter = { command = "nixpkgs-fmt"; }; }
auto-format = true;
formatter = { command = "nixpkgs-fmt"; };
}
{ name = "html"; auto-format = true; indent = { tab-width = 4; unit = "\t"; }; }
]; ];
grammar = [ grammar = [
{ {