Update various configuration files

Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
TuDatTr
2023-06-01 14:06:18 +02:00
parent e9d53f0b66
commit 48eace8cee
11 changed files with 305 additions and 77 deletions

View File

@@ -1,4 +1,6 @@
# Nushell Config File
#
# version = 0.79.1
# For more information on defining custom themes, see
# https://www.nushell.sh/book/coloring_and_theming.html
@@ -12,7 +14,7 @@ let dark_theme = {
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 { 'light_cyan' } else { 'light_gray' } }
bool: {|| if $in { 'light_cyan' } else { 'light_gray' } }
int: white
filesize: {|e|
if $e == 0b {
@@ -22,23 +24,23 @@ let dark_theme = {
} else { 'blue' }
}
duration: white
date: { || (date now) - $in |
date: {|| (date now) - $in |
if $in < 1hr {
'red3b'
'purple'
} else if $in < 6hr {
'orange3'
'red'
} else if $in < 1day {
'yellow3b'
'yellow'
} else if $in < 3day {
'chartreuse2b'
'green'
} else if $in < 1wk {
'green3b'
'light_green'
} else if $in < 6wk {
'darkturquoise'
'cyan'
} else if $in < 52wk {
'deepskyblue3b'
'blue'
} else { 'dark_gray' }
}
}
range: white
float: white
string: white
@@ -55,6 +57,7 @@ let dark_theme = {
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
@@ -64,12 +67,13 @@ let dark_theme = {
shape_flag: blue_bold
shape_float: purple_bold
# shapes are used to change the cli syntax highlighting
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
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
@@ -83,6 +87,7 @@ let dark_theme = {
shape_string_interpolation: cyan_bold
shape_table: blue_bold
shape_variable: purple
shape_vardecl: purple
}
let light_theme = {
@@ -93,7 +98,7 @@ let light_theme = {
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' } }
bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
int: dark_gray
filesize: {|e|
if $e == 0b {
@@ -103,21 +108,21 @@ let light_theme = {
} else { 'blue_bold' }
}
duration: dark_gray
date: { || (date now) - $in |
date: {|| (date now) - $in |
if $in < 1hr {
'red3b'
'purple'
} else if $in < 6hr {
'orange3'
'red'
} else if $in < 1day {
'yellow3b'
'yellow'
} else if $in < 3day {
'chartreuse2b'
'green'
} else if $in < 1wk {
'green3b'
'light_green'
} else if $in < 6wk {
'darkturquoise'
'cyan'
} else if $in < 52wk {
'deepskyblue3b'
'blue'
} else { 'dark_gray' }
}
range: dark_gray
@@ -136,6 +141,7 @@ let light_theme = {
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
@@ -145,12 +151,13 @@ let light_theme = {
shape_flag: blue_bold
shape_float: purple_bold
# shapes are used to change the cli syntax highlighting
shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
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
@@ -164,6 +171,7 @@ let light_theme = {
shape_string_interpolation: cyan_bold
shape_table: blue_bold
shape_variable: purple
shape_vardecl: purple
}
# External completer example
@@ -174,6 +182,8 @@ let light_theme = {
# The default config record. This is where much of your global configuration is setup.
let-env config = {
# true or false to enable or disable the welcome banner at startup
show_banner: false
ls: {
use_ls_colors: true # use the LS_COLORS environment variable to colorize output
clickable_links: true # enable or disable clickable links. Your terminal has to support links.
@@ -186,6 +196,8 @@ let-env config = {
}
table: {
mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
show_empty: true # show 'empty list' and 'empty record' placeholders for command output
trim: {
methodology: wrapping # wrapping or truncating
wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
@@ -254,6 +266,7 @@ let-env config = {
max_size: 10000 # 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
file_format: "plaintext" # "sqlite" or "plaintext"
# history_isolation: true # true enables history isolation, false disables it. true will allow the history to be isolated to the current session. false will allow the history to be shared across all sessions.
}
completions: {
case_sensitive: false # set to true to enable case-sensitive completions
@@ -270,7 +283,11 @@ let-env config = {
metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
}
cursor_shape: {
emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line (line is the default)
vi_insert: block # block, underscore, line , blink_block, blink_underscore, blink_line (block is the default)
vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line (underscore is the default)
}
color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme`
use_grid_icons: true
footer_mode: "25" # always, never, number_of_rows, auto
@@ -279,26 +296,27 @@ let-env config = {
use_ansi_coloring: true
edit_mode: emacs # emacs, vi
shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
# true or false to enable or disable the welcome banner at startup
show_banner: false
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
#hooks: {
# pre_prompt: [{ ||
# null # replace with source code to run before the prompt is shown
# }]
# pre_execution: [{ ||
# null # replace with source code to run before the repl input is run
# }]
# env_change: { ||
# PWD: [{|before, after|
# null # replace with source code to run if the PWD environment is different since the last repl input
# }]
# }
# display_output: { ||
# if (term size).columns >= 100 { table -e } else { table }
# }
#}
hooks: {
pre_prompt: [{||
null # replace with source code to run before the prompt is shown
}]
pre_execution: [{||
null # replace with source code to run before the repl input is run
}]
env_change: {
PWD: [{|before, after|
null # replace with source code to run if the PWD environment is different since the last repl input
}]
}
display_output: {||
if (term size).columns >= 100 { table -e } else { table }
}
command_not_found: {||
null # replace with source code to return an error message when a command is not found
}
}
menus: [
# Configuration for default nushell menus
# Note the lack of source parameter
@@ -520,16 +538,19 @@ let-env config = {
event: { send: menu name: commands_with_description }
}
]
}
def add_soft [project] { git remote add soft $"ssh://git.aya00:/($project)" }
export def-env own_ranger [] {
let lastdir_path = $"($env.HOME)/.rangerdir";
^ranger $"--choosedir=($lastdir_path)";
let lastdir = (open $lastdir_path);
cd $lastdir
}
alias ll = ls -la
alias la = ls -a
alias q = exit
alias e = emacsclient -t
alias ekill = (pkill emacs;pkill emacsclient;emacs --daemon)
alias picotik = picocom --b 115199 /dev/ttyUSB0
alias nmap = ^nmap -T5 --min-parallelism 100 -Pn
alias ed = emacs --daemon
@@ -540,6 +561,7 @@ alias wttr = curl wttr.in/Essen
alias tvres = xrandr --output HDMI1 --transform 1.02,0,-20,0,1.02,-10,0,0,1
alias defaultres = xrandr --output HDMI1 --transform 1.00,0,0,0,1.00,0,0,0,1
alias latexmk = ^latexmk -f -pdf -interaction=nonstopmode
alias ranger = own_ranger
# git
alias gpa = git push all --all