dotfiles
bugabingas dorkfiles
owned by bugabinga
Modernize Nushell startup layout
6490c478e1aaf43e4a82e354f50ccb5cdd7b7e27
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (4)
nushell/autoload/30-completion.nu
Addednew file mode 100644 1 +source (
$nu.default-config-dir | path join modules completion.nu)
nushell/config.nu
Modified 4 - buffer_editor:
"nvim" 5 - table: {mode: markdown}
7 - always_trash: (not
$env.TERMUX)
9 - cursor_shape: {vi_insert: line, vi_normal: block}
11 - shell_integration: {
14 - osc133: (
$nu.os-info.family | str contains
"unix")
16 - highlight_resolved_externals: true
17 - use_kitty_protocol: (not
$env.WIN32)
1 +use std/util
"path add" 29 - cell-path: dark_gray
4 + (
$nu.default-config-dir | path join modules)
32 - separator: light_green
33 - header: light_blue_bold
34 - row_index: light_green
35 - leading_trailing_space_bg: dark_gray
38 - search_result: green_bold
7 +$env.WIN32 = (
$nu.os-info.name =~
"windows")
8 +$env.TERMUX = (
$nu.os-info.name =~
"android")
43 - shape_raw_string: blue
44 - shape_string_interpolation: green_bold
45 - shape_int: green_bold
46 - shape_float: green_bold
47 - shape_bool: green_bold
48 - shape_filepath: green
49 - shape_directory: green
50 - shape_globpattern: green
51 - shape_glob_interpolation: green_bold
55 - shape_datetime: green_bold
56 - shape_match_pattern: blue
57 - shape_signature: blue
58 - shape_literal: white
59 - shape_custom: magenta_bold
60 - shape_closure: blue_bold
61 - shape_block: blue_bold
62 - shape_range: dark_gray
65 - shape_keyword: dark_gray
66 - shape_operator: dark_gray
67 - shape_pipe: dark_gray
68 - shape_redirection: dark_gray
69 - shape_flag: light_cyan
70 - shape_binary: dark_gray
71 - shape_nothing: dark_gray
72 - shape_matching_brackets: dark_gray_bold
73 - shape_vardecl: white
74 - shape_variable: white
77 - shape_external: light_magenta
78 - shape_externalarg: green_bold
79 - shape_external_resolved: magenta_bold
80 - shape_internalcall: light_cyan_bold
83 - shape_garbage: {fg: white, bg: red, attr: b}
85 - history: {file_format:
"sqlite", isolation: true}
10 +$env.WORKSPACE =
if $env.WIN32 {
"~/Workspace" }
else {
11 + "~/Workspace" | path expand
13 +$env.DOTFILES = (
$env.WORKSPACE | path join
"dotfiles" | path expand)
14 +$env.NOTES = (
"~/Notes" | path expand)
15 +$env.TOOLS = (
"~/Tools" | path expand)
16 +$env.CARGO_HOME = (
"~/.cargo" | path expand)
17 +$env.GO_HOME = (
"~/.go" | path expand)
18 +$env.DOT_LOCAL = (
"~/.local" | path expand)
19 +$env.DIFFTOOL =
"zeditor --wait --diff" 20 +$env.BUN_HOME = (
"~/.bun" | path expand)
22 +path add --append (
$env.CARGO_HOME | path join bin)
23 +path add --append (
$env.GO_HOME | path join bin)
24 +path add --append (
$env.TOOLS | path join bin)
25 +path add --append (
$env.BUN_HOME | path join bin)
27 + path add --append (
$env.DOT_LOCAL | path join bin)
30 +if (not
$env.WIN32) and (
$env.XDG_RUNTIME_DIR? != null) {
32 + $env.SSH_AUTH_SOCK = $
"($env.XDG_RUNTIME_DIR)/ssh-agent.socket" 35 +$env.PI_SKIP_VERSION_CHECK = true
36 +$env.PI_TELEMETRY = true
38 +$env.PI_CODING_AGENT_SESSION_DIR =
"~/.local/state/pi/sessions" | path expand
39 +$env.PI_CACHE_RETENTION =
"long" 41 +if (which sccache | is-not-empty) {
42 + $env.RUSTC_WRAPPER =
"sccache" 45 +if (which nvim | is-not-empty) {
46 + $env.EDITOR =
"nvim" 47 + $env.GIT_EDITOR =
"nvim" 50 +if (which neovide | is-not-empty) {
51 + $env.VISUAL =
"neovide" 54 +$env.LS_COLORS =
"rs=0:di=1;34:ln=1;35:ex=1;32:bd=1;33;40:cd=1;33;40:pi=33:so=35:do=35:or=1;31:mi=1;37;41:su=37;41:sg=30;43:tw=30;41:ow=37;41:st=37;44:*.tar=1;31:*.tgz=1;31:*.zip=1;31:*.gz=1;31:*.xz=1;31:*.7z=1;31:*.rar=1;31:*.jpg=1;35:*.png=1;35:*.gif=1;35:*.bmp=1;35:*.mp4=1;33:*.mp3=1;33:*.flac=1;33:*.pdf=1;33:*.doc=1;33:*.docx=1;33:*.txt=0:*.md=0:*.c=1;34:*.cpp=1;34:*.h=1;34:*.java=1;34:*.py=1;34:*.sh=1;34:" 58 +$env.CARAPACE_BRIDGES =
"bash" 59 +$env.CARAPACE_LENIENT =
1 61 +$env.config.show_banner = false
62 +$env.config.edit_mode =
"vi" 63 +$env.config.buffer_editor =
"nvim" 64 +$env.config.table.mode =
"markdown" 65 +$env.config.rm.always_trash = (not
$env.TERMUX)
66 +$env.config.cursor_shape.vi_insert =
"line" 67 +$env.config.cursor_shape.vi_normal =
"block" 68 +$env.config.float_precision =
3 70 +$env.config.shell_integration.osc133 = (
$nu.os-info.family | str contains
"unix")
71 +$env.config.highlight_resolved_externals = true
72 +$env.config.use_kitty_protocol = (not
$env.WIN32)
73 +$env.config.history.file_format =
"sqlite" 74 +$env.config.history.isolation = true
76 +$env.config.color_config = {
86 + cell-path: dark_gray
89 + separator: light_green
90 + header: light_blue_bold
91 + row_index: light_green
92 + leading_trailing_space_bg: dark_gray
95 + search_result: green_bold
100 + shape_raw_string: blue
101 + shape_string_interpolation: green_bold
102 + shape_int: green_bold
103 + shape_float: green_bold
104 + shape_bool: green_bold
105 + shape_filepath: green
106 + shape_directory: green
107 + shape_globpattern: green
108 + shape_glob_interpolation: green_bold
109 + shape_record: green
112 + shape_datetime: green_bold
113 + shape_match_pattern: blue
114 + shape_signature: blue
115 + shape_literal: white
116 + shape_custom: magenta_bold
117 + shape_closure: blue_bold
118 + shape_block: blue_bold
119 + shape_range: dark_gray
122 + shape_keyword: dark_gray
123 + shape_operator: dark_gray
124 + shape_pipe: dark_gray
125 + shape_redirection: dark_gray
126 + shape_flag: light_cyan
127 + shape_binary: dark_gray
128 + shape_nothing: dark_gray
129 + shape_matching_brackets: dark_gray_bold
130 + shape_vardecl: white
131 + shape_variable: white
134 + shape_external: light_magenta
135 + shape_externalarg: green_bold
136 + shape_external_resolved: magenta_bold
137 + shape_internalcall: light_cyan_bold
140 + shape_garbage: {fg: white, bg: red, attr: b}
144 +source (
$nu.default-config-dir | path join
"gen-aliases.nu")
5 -$env.WIN32 = (
$nu.os-info.name =~
"windows")
6 -$env.TERMUX = (
$nu.os-info.name =~
"android")
8 -$env.WORKSPACE =
if $env.WIN32 {
"~/Workspace" }
else {
9 - "~/Workspace" | path expand
11 -$env.DOTFILES = (
$env.WORKSPACE | path join
'dotfiles' | path expand)
12 -$env.NOTES = (
"~/Notes" | path expand)
13 -$env.TOOLS = (
"~/Tools" | path expand)
14 -$env.CARGO_HOME = (
"~/.cargo" | path expand)
15 -$env.GO_HOME = (
"~/.go" | path expand)
16 -$env.DOT_LOCAL = (
"~/.local" | path expand)
17 -$env.DIFFTOOL =
"zeditor --wait --diff" 18 -$env.BUN_HOME = (
"~/.bun" | path expand)
22 - $env.SSH_AUTH_SOCK = $
"($env.XDG_RUNTIME_DIR)/ssh-agent.socket" 25 -$env.PI_SKIP_VERSION_CHECK = true
26 -$env.PI_TELEMETRY = true
28 -$env.PI_CODING_AGENT_SESSION_DIR =
"~/.local/state/pi/sessions" | path expand
29 -$env.PI_CACHE_RETENTION =
"long" 31 -if (which sccache | is-not-empty) {
$env.RUSTC_WRAPPER =
"sccache" }
36 - | split row (char esep)
37 - | append (
$env.CARGO_HOME | path join bin)
38 - | append (
$env.GO_HOME | path join bin)
39 - | append (
$env.TOOLS | path join bin)
40 - | append (
$env.BUN_HOME | path join bin)
46 - | split row (char esep)
47 - | append (
$env.CARGO_HOME | path join bin)
48 - | append (
$env.GO_HOME | path join bin)
49 - | append (
$env.TOOLS | path join bin)
50 - | append (
$env.DOT_LOCAL | path join bin)
51 - | append (
$env.BUN_HOME | path join bin)
56 -if (which nvim | is-not-empty) {
57 - $env.EDITOR =
'nvim' 58 - $env.GIT_EDITOR =
'nvim' 61 -if (which neovide | is-not-empty) {
62 - $env.VISUAL =
'neovide' 65 -$env.LS_COLORS =
'rs=0:di=1;34:ln=1;35:ex=1;32:bd=1;33;40:cd=1;33;40:pi=33:so=35:do=35:or=1;31:mi=1;37;41:su=37;41:sg=30;43:tw=30;41:ow=37;41:st=37;44:*.tar=1;31:*.tgz=1;31:*.zip=1;31:*.gz=1;31:*.xz=1;31:*.7z=1;31:*.rar=1;31:*.jpg=1;35:*.png=1;35:*.gif=1;35:*.bmp=1;35:*.mp4=1;33:*.mp3=1;33:*.flac=1;33:*.pdf=1;33:*.doc=1;33:*.docx=1;33:*.txt=0:*.md=0:*.c=1;34:*.cpp=1;34:*.h=1;34:*.java=1;34:*.py=1;34:*.sh=1;34:' 71 -$env.ENV_CONVERSIONS = {
74 - $s | split row (char esep)
77 - $v | str join (char esep)
82 - $s | split row (char esep)
85 - $v | str join (char esep)
91 - (
$nu.default-config-dir | path join
'modules')
96 -source (
$nu.default-config-dir | path join
'gen-aliases.nu')
101 -let zoxide_config_path =
$nu.default-config-dir | path join
'zoxide.nu' 102 -if not (which zoxide | is-empty) {
103 - zoxide init nushell | save --force
$zoxide_config_path 105 - '' | save -f
$zoxide_config_path 110 -$env.CARAPACE_BRIDGES =
'bash' 111 -$env.CARAPACE_LENIENT =
1 113 -if not (which mise | is-empty) {
114 - mkdir (
$nu.vendor-autoload-dirs | last)
115 - ^mise activate nu | str replace --all
'str upcase' 'str uppercase' | str replace --all
'str downcase' 'str lowercase' | save --force (
$nu.vendor-autoload-dirs | last | path join
'mise.nu')
118 -if not (which niri | is-empty) {
119 - mkdir (
$nu.vendor-autoload-dirs | last)
120 - ^niri completions nushell | save --force (
$nu.vendor-autoload-dirs | last | path join
'niri.nu')
25 -use std/util
"path add" 27 26 export def vx [...rest] {
28 27 NVIM_APPNAME=nvim-minimax nvim ...
$rest 30 +let save_if_changed = {|path: path, content: string|
31 + if (not (
$path | path exists)) or ((open --raw
$path) !=
$content) {
32 + $content | save --force
$path 36 +let zoxide_config_path = (
$nu.default-config-dir | path join
"zoxide.nu")
37 +if not (which zoxide | is-empty) {
38 + do $save_if_changed $zoxide_config_path (zoxide init nushell)
40 + do $save_if_changed $zoxide_config_path "" 43 +let vendor_dir = (
$nu.vendor-autoload-dirs | last)
46 +if not (which mise | is-empty) {
49 + | str replace --all
"str upcase" "str uppercase" 50 + | str replace --all
"str downcase" "str lowercase" 52 + do $save_if_changed (
$vendor_dir | path join
"mise.nu")
$mise_config 55 +if not (which niri | is-empty) {
56 + do $save_if_changed (
$vendor_dir | path join
"niri.nu") (^niri completions nushell)
31 59 source (
$nu.default-config-dir | path join
'aliases.nu')
32 60 source (
$nu.default-config-dir | path join
'secrets.nu')
33 61 source (
$nu.default-config-dir | path join
"zoxide.nu")
34 -source (
$nu.default-config-dir | path join
"modules" "completion.nu")
36 63 work_scope generate