(mirror) personal dotfiles github.com/crescentrose/dotfiles

refactor: remove stale nushell files

+3 -976
-1
config/nushell/.gitignore
··· 1 - history.txt
-12
config/nushell/alias.nu
··· 1 - use load-secrets.nu 2 - 3 - alias vim = nvim 4 - alias venv = sh -i -c 'source .venv/bin/activate ; nu' 5 - 6 - def --env dotenv [] { 7 - nuopen .env | from toml | load-env 8 - } 9 - 10 - def --env secrets [] { 11 - load-secrets from-1password 12 - }
-865
config/nushell/config.nu
··· 1 - # Nushell Config File 2 - # 3 - # version = "0.90.2" 4 - 5 - # Load custom utilities 6 - source ([$nu.default-config-dir "utils.nu"] | path join) 7 - 8 - # Load aliases 9 - source ([$nu.default-config-dir "alias.nu"] | path join) 10 - 11 - # For more information on defining custom themes, see 12 - # https://www.nushell.sh/book/coloring_and_theming.html 13 - # And here is the theme collection 14 - # https://github.com/nushell/nu_scripts/tree/main/themes 15 - let dark_theme = { 16 - # color for nushell primitives 17 - separator: white 18 - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off 19 - header: green_bold 20 - empty: blue 21 - # Closures can be used to choose colors for specific values. 22 - # The value (in this case, a bool) is piped into the closure. 23 - # eg) {|| if $in { 'light_cyan' } else { 'light_gray' } } 24 - bool: light_cyan 25 - int: white 26 - filesize: cyan 27 - duration: white 28 - date: purple 29 - range: white 30 - float: white 31 - string: white 32 - nothing: white 33 - binary: white 34 - cell-path: white 35 - row_index: green_bold 36 - record: white 37 - list: white 38 - block: white 39 - hints: dark_gray 40 - search_result: {bg: red fg: white} 41 - shape_and: purple_bold 42 - shape_binary: purple_bold 43 - shape_block: blue_bold 44 - shape_bool: light_cyan 45 - shape_closure: green_bold 46 - shape_custom: green 47 - shape_datetime: cyan_bold 48 - shape_directory: cyan 49 - shape_external: cyan 50 - shape_externalarg: green_bold 51 - shape_external_resolved: light_yellow_bold 52 - shape_filepath: cyan 53 - shape_flag: blue_bold 54 - shape_float: purple_bold 55 - # shapes are used to change the cli syntax highlighting 56 - shape_garbage: { fg: white bg: red attr: b} 57 - shape_globpattern: cyan_bold 58 - shape_int: purple_bold 59 - shape_internalcall: cyan_bold 60 - shape_keyword: cyan_bold 61 - shape_list: cyan_bold 62 - shape_literal: blue 63 - shape_match_pattern: green 64 - shape_matching_brackets: { attr: u } 65 - shape_nothing: light_cyan 66 - shape_operator: yellow 67 - shape_or: purple_bold 68 - shape_pipe: purple_bold 69 - shape_range: yellow_bold 70 - shape_record: cyan_bold 71 - shape_redirection: purple_bold 72 - shape_signature: green_bold 73 - shape_string: green 74 - shape_string_interpolation: cyan_bold 75 - shape_table: blue_bold 76 - shape_variable: purple 77 - shape_vardecl: purple 78 - } 79 - 80 - let light_theme = { 81 - # color for nushell primitives 82 - separator: dark_gray 83 - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off 84 - header: green_bold 85 - empty: blue 86 - # Closures can be used to choose colors for specific values. 87 - # The value (in this case, a bool) is piped into the closure. 88 - # eg) {|| if $in { 'dark_cyan' } else { 'dark_gray' } } 89 - bool: dark_cyan 90 - int: dark_gray 91 - filesize: cyan_bold 92 - duration: dark_gray 93 - date: purple 94 - range: dark_gray 95 - float: dark_gray 96 - string: dark_gray 97 - nothing: dark_gray 98 - binary: dark_gray 99 - cell-path: dark_gray 100 - row_index: green_bold 101 - record: dark_gray 102 - list: dark_gray 103 - block: dark_gray 104 - hints: dark_gray 105 - search_result: {fg: white bg: red} 106 - shape_and: purple_bold 107 - shape_binary: purple_bold 108 - shape_block: blue_bold 109 - shape_bool: light_cyan 110 - shape_closure: green_bold 111 - shape_custom: green 112 - shape_datetime: cyan_bold 113 - shape_directory: cyan 114 - shape_external: cyan 115 - shape_externalarg: green_bold 116 - shape_external_resolved: light_purple_bold 117 - shape_filepath: cyan 118 - shape_flag: blue_bold 119 - shape_float: purple_bold 120 - # shapes are used to change the cli syntax highlighting 121 - shape_garbage: { fg: white bg: red attr: b} 122 - shape_globpattern: cyan_bold 123 - shape_int: purple_bold 124 - shape_internalcall: cyan_bold 125 - shape_keyword: cyan_bold 126 - shape_list: cyan_bold 127 - shape_literal: blue 128 - shape_match_pattern: green 129 - shape_matching_brackets: { attr: u } 130 - shape_nothing: light_cyan 131 - shape_operator: yellow 132 - shape_or: purple_bold 133 - shape_pipe: purple_bold 134 - shape_range: yellow_bold 135 - shape_record: cyan_bold 136 - shape_redirection: purple_bold 137 - shape_signature: green_bold 138 - shape_string: green 139 - shape_string_interpolation: cyan_bold 140 - shape_table: blue_bold 141 - shape_variable: purple 142 - shape_vardecl: purple 143 - } 144 - 145 - 146 - # The default config record. This is where much of your global configuration is setup. 147 - $env.config = { 148 - show_banner: false # true or false to enable or disable the welcome banner at startup 149 - 150 - ls: { 151 - clickable_links: true # enable or disable clickable links. Your terminal has to support links. 152 - use_ls_colors: false # set this to true to enable file/path/directory completions using LS_COLORS 153 - } 154 - 155 - rm: { 156 - always_trash: false # always act as if -t was given. Can be overridden with -p 157 - } 158 - 159 - table: { 160 - mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other 161 - index_mode: auto # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column 162 - show_empty: true # show 'empty list' and 'empty record' placeholders for command output 163 - padding: { left: 1, right: 1 } # a left right padding of each column in a table 164 - trim: { 165 - methodology: wrapping # wrapping or truncating 166 - wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology 167 - truncating_suffix: "..." # A suffix used by the 'truncating' methodology 168 - } 169 - header_on_separator: false # show header text on separator/border line 170 - # abbreviated_row_count: 10 # limit data rows from top and bottom after reaching a set point 171 - } 172 - 173 - error_style: "fancy" # "fancy" or "plain" for screen reader-friendly error messages 174 - 175 - # datetime_format determines what a datetime rendered in the shell would look like. 176 - # Behavior without this configuration point will be to "humanize" the datetime display, 177 - # showing something like "a day ago." 178 - datetime_format: { 179 - # normal: '%a, %d %b %Y %H:%M:%S %z' # shows up in displays of variables or other datetime's outside of tables 180 - # table: '%m/%d/%y %I:%M:%S%p' # generally shows up in tabular outputs such as ls. commenting this out will change it to the default human readable datetime format 181 - } 182 - 183 - explore: { 184 - status_bar_background: {fg: "#1D1F21", bg: "#C4C9C6"}, 185 - command_bar_text: {fg: "#C4C9C6"}, 186 - highlight: {fg: "black", bg: "yellow"}, 187 - status: { 188 - error: {fg: "white", bg: "red"}, 189 - warn: {} 190 - info: {} 191 - }, 192 - table: { 193 - split_line: {fg: "#404040"}, 194 - selected_cell: {bg: light_blue}, 195 - selected_row: {}, 196 - selected_column: {}, 197 - }, 198 - } 199 - 200 - history: { 201 - max_size: 100_000 # Session has to be reloaded for this to take effect 202 - sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file 203 - file_format: "plaintext" # "sqlite" or "plaintext" 204 - 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. 205 - } 206 - 207 - completions: { 208 - case_sensitive: false # set to true to enable case-sensitive completions 209 - quick: true # set this to false to prevent auto-selecting completions when only one remains 210 - partial: true # set this to false to prevent partial filling of the prompt 211 - algorithm: "prefix" # prefix or fuzzy 212 - external: { 213 - 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 214 - max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options 215 - completer: null 216 - } 217 - } 218 - 219 - filesize: { 220 - unit: "metric" 221 - precision: 1 222 - } 223 - 224 - cursor_shape: { 225 - emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (line is the default) 226 - vi_insert: block # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (block is the default) 227 - vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line, inherit to skip setting cursor shape (underscore is the default) 228 - } 229 - 230 - color_config: $dark_theme # if you want a more interesting theme, you can replace the empty record with `$dark_theme`, `$light_theme` or another custom record 231 - footer_mode: "auto" # always, never, number_of_rows, auto 232 - float_precision: 2 # the precision for displaying floats in tables 233 - buffer_editor: "" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL 234 - use_ansi_coloring: true 235 - bracketed_paste: true # enable bracketed paste, currently useless on windows 236 - edit_mode: emacs # emacs, vi 237 - shell_integration: { 238 - osc2: true, 239 - osc7: true, 240 - osc8: true, 241 - osc9_9: false, 242 - osc133: true, 243 - osc633: true, 244 - reset_application_mode: true 245 - } # enables terminal shell integration. Off by default, as some terminals have issues with this. 246 - 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. 247 - use_kitty_protocol: true # enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this. 248 - highlight_resolved_externals: true # true enables highlighting of external commands in the repl resolved by which. 249 - 250 - plugins: {} # Per-plugin configuration. See https://www.nushell.sh/contributor-book/plugins.html#configuration. 251 - 252 - hooks: { 253 - pre_prompt: [{ null }] # run before the prompt is shown 254 - pre_execution: [{ null }] # run before the repl input is run 255 - display_output: "if (term size).columns >= 100 { table -e } else { table }" # run to display the output of a pipeline 256 - command_not_found: { |cmd| 257 - if (which command-not-found | is-empty) { 258 - return null 259 - } 260 - let help = (command-not-found $cmd) 261 - 262 - $"(ansi $env.config.color_config.shape_external)($help)(ansi reset)" 263 - } 264 - env_change: { 265 - PWD: [{ || 266 - if (which direnv | is-empty) { 267 - return 268 - } 269 - 270 - direnv export json | from json | default {} | load-env 271 - }] 272 - } 273 - } 274 - 275 - menus: [ 276 - # Configuration for default nushell menus 277 - # Note the lack of source parameter 278 - { 279 - name: completion_menu 280 - only_buffer_difference: false 281 - marker: "" 282 - type: { 283 - layout: columnar 284 - columns: 4 285 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width 286 - col_padding: 2 287 - } 288 - style: { 289 - text: green 290 - selected_text: {attr: r} 291 - description_text: yellow 292 - match_text: {attr: u} 293 - selected_match_text: {attr: ur} 294 - } 295 - } 296 - { 297 - name: ide_completion_menu 298 - only_buffer_difference: false 299 - marker: "| " 300 - type: { 301 - layout: ide 302 - min_completion_width: 0, 303 - max_completion_width: 50, 304 - # max_completion_height: 10, # will be limited by the available lines in the terminal 305 - padding: 0, 306 - border: true, 307 - cursor_offset: 0, 308 - description_mode: "prefer_right" 309 - min_description_width: 0 310 - max_description_width: 50 311 - max_description_height: 10 312 - description_offset: 1 313 - # If true, the cursor pos will be corrected, so the suggestions match up with the typed text 314 - # 315 - # C:\> str 316 - # str join 317 - # str trim 318 - # str split 319 - correct_cursor_pos: false 320 - } 321 - style: { 322 - text: green 323 - selected_text: {attr: r} 324 - description_text: yellow 325 - match_text: {attr: u} 326 - selected_match_text: {attr: ur} 327 - } 328 - } 329 - { 330 - name: history_menu 331 - only_buffer_difference: true 332 - marker: "? " 333 - type: { 334 - layout: list 335 - page_size: 10 336 - } 337 - style: { 338 - text: green 339 - selected_text: green_reverse 340 - description_text: yellow 341 - } 342 - } 343 - { 344 - name: help_menu 345 - only_buffer_difference: true 346 - marker: "? " 347 - type: { 348 - layout: description 349 - columns: 4 350 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width 351 - col_padding: 2 352 - selection_rows: 4 353 - description_rows: 10 354 - } 355 - style: { 356 - text: green 357 - selected_text: green_reverse 358 - description_text: yellow 359 - } 360 - } 361 - ] 362 - 363 - keybindings: [ 364 - { 365 - name: completion_menu 366 - modifier: none 367 - keycode: tab 368 - mode: [emacs vi_normal vi_insert] 369 - event: { 370 - until: [ 371 - { send: menu name: completion_menu } 372 - { send: menunext } 373 - { edit: complete } 374 - ] 375 - } 376 - } 377 - { 378 - name: ide_completion_menu 379 - modifier: control 380 - keycode: char_n 381 - mode: [emacs vi_normal vi_insert] 382 - event: { 383 - until: [ 384 - { send: menu name: ide_completion_menu } 385 - { send: menunext } 386 - { edit: complete } 387 - ] 388 - } 389 - } 390 - { 391 - name: history_menu 392 - modifier: control 393 - keycode: char_r 394 - mode: [emacs, vi_insert, vi_normal] 395 - event: { send: menu name: history_menu } 396 - } 397 - { 398 - name: help_menu 399 - modifier: none 400 - keycode: f1 401 - mode: [emacs, vi_insert, vi_normal] 402 - event: { send: menu name: help_menu } 403 - } 404 - { 405 - name: completion_previous_menu 406 - modifier: shift 407 - keycode: backtab 408 - mode: [emacs, vi_normal, vi_insert] 409 - event: { send: menuprevious } 410 - } 411 - { 412 - name: next_page_menu 413 - modifier: control 414 - keycode: char_x 415 - mode: emacs 416 - event: { send: menupagenext } 417 - } 418 - { 419 - name: undo_or_previous_page_menu 420 - modifier: control 421 - keycode: char_z 422 - mode: emacs 423 - event: { 424 - until: [ 425 - { send: menupageprevious } 426 - { edit: undo } 427 - ] 428 - } 429 - } 430 - { 431 - name: escape 432 - modifier: none 433 - keycode: escape 434 - mode: [emacs, vi_normal, vi_insert] 435 - event: { send: esc } # NOTE: does not appear to work 436 - } 437 - { 438 - name: cancel_command 439 - modifier: control 440 - keycode: char_c 441 - mode: [emacs, vi_normal, vi_insert] 442 - event: { send: ctrlc } 443 - } 444 - { 445 - name: quit_shell 446 - modifier: control 447 - keycode: char_d 448 - mode: [emacs, vi_normal, vi_insert] 449 - event: { send: ctrld } 450 - } 451 - { 452 - name: clear_screen 453 - modifier: control 454 - keycode: char_l 455 - mode: [emacs, vi_normal, vi_insert] 456 - event: { send: clearscreen } 457 - } 458 - { 459 - name: search_history 460 - modifier: control 461 - keycode: char_q 462 - mode: [emacs, vi_normal, vi_insert] 463 - event: { send: searchhistory } 464 - } 465 - { 466 - name: open_command_editor 467 - modifier: control 468 - keycode: char_o 469 - mode: [emacs, vi_normal, vi_insert] 470 - event: { send: openeditor } 471 - } 472 - { 473 - name: move_up 474 - modifier: none 475 - keycode: up 476 - mode: [emacs, vi_normal, vi_insert] 477 - event: { 478 - until: [ 479 - {send: menuup} 480 - {send: up} 481 - ] 482 - } 483 - } 484 - { 485 - name: move_down 486 - modifier: none 487 - keycode: down 488 - mode: [emacs, vi_normal, vi_insert] 489 - event: { 490 - until: [ 491 - {send: menudown} 492 - {send: down} 493 - ] 494 - } 495 - } 496 - { 497 - name: move_left 498 - modifier: none 499 - keycode: left 500 - mode: [emacs, vi_normal, vi_insert] 501 - event: { 502 - until: [ 503 - {send: menuleft} 504 - {send: left} 505 - ] 506 - } 507 - } 508 - { 509 - name: move_right_or_take_history_hint 510 - modifier: none 511 - keycode: right 512 - mode: [emacs, vi_normal, vi_insert] 513 - event: { 514 - until: [ 515 - {send: historyhintcomplete} 516 - {send: menuright} 517 - {send: right} 518 - ] 519 - } 520 - } 521 - { 522 - name: move_one_word_left 523 - modifier: control 524 - keycode: left 525 - mode: [emacs, vi_normal, vi_insert] 526 - event: {edit: movewordleft} 527 - } 528 - { 529 - name: move_one_word_right_or_take_history_hint 530 - modifier: control 531 - keycode: right 532 - mode: [emacs, vi_normal, vi_insert] 533 - event: { 534 - until: [ 535 - {send: historyhintwordcomplete} 536 - {edit: movewordright} 537 - ] 538 - } 539 - } 540 - { 541 - name: move_to_line_start 542 - modifier: none 543 - keycode: home 544 - mode: [emacs, vi_normal, vi_insert] 545 - event: {edit: movetolinestart} 546 - } 547 - { 548 - name: move_to_line_start 549 - modifier: control 550 - keycode: char_a 551 - mode: [emacs, vi_normal, vi_insert] 552 - event: {edit: movetolinestart} 553 - } 554 - { 555 - name: move_to_line_end_or_take_history_hint 556 - modifier: none 557 - keycode: end 558 - mode: [emacs, vi_normal, vi_insert] 559 - event: { 560 - until: [ 561 - {send: historyhintcomplete} 562 - {edit: movetolineend} 563 - ] 564 - } 565 - } 566 - { 567 - name: move_to_line_end_or_take_history_hint 568 - modifier: control 569 - keycode: char_e 570 - mode: [emacs, vi_normal, vi_insert] 571 - event: { 572 - until: [ 573 - {send: historyhintcomplete} 574 - {edit: movetolineend} 575 - ] 576 - } 577 - } 578 - { 579 - name: move_to_line_start 580 - modifier: control 581 - keycode: home 582 - mode: [emacs, vi_normal, vi_insert] 583 - event: {edit: movetolinestart} 584 - } 585 - { 586 - name: move_to_line_end 587 - modifier: control 588 - keycode: end 589 - mode: [emacs, vi_normal, vi_insert] 590 - event: {edit: movetolineend} 591 - } 592 - { 593 - name: move_up 594 - modifier: control 595 - keycode: char_p 596 - mode: [emacs, vi_normal, vi_insert] 597 - event: { 598 - until: [ 599 - {send: menuup} 600 - {send: up} 601 - ] 602 - } 603 - } 604 - { 605 - name: move_down 606 - modifier: control 607 - keycode: char_t 608 - mode: [emacs, vi_normal, vi_insert] 609 - event: { 610 - until: [ 611 - {send: menudown} 612 - {send: down} 613 - ] 614 - } 615 - } 616 - { 617 - name: delete_one_character_backward 618 - modifier: none 619 - keycode: backspace 620 - mode: [emacs, vi_insert] 621 - event: {edit: backspace} 622 - } 623 - { 624 - name: delete_one_word_backward 625 - modifier: control 626 - keycode: backspace 627 - mode: [emacs, vi_insert] 628 - event: {edit: backspaceword} 629 - } 630 - { 631 - name: delete_one_character_forward 632 - modifier: none 633 - keycode: delete 634 - mode: [emacs, vi_insert] 635 - event: {edit: delete} 636 - } 637 - { 638 - name: delete_one_character_forward 639 - modifier: control 640 - keycode: delete 641 - mode: [emacs, vi_insert] 642 - event: {edit: delete} 643 - } 644 - { 645 - name: delete_one_character_forward 646 - modifier: control 647 - keycode: char_h 648 - mode: [emacs, vi_insert] 649 - event: {edit: backspace} 650 - } 651 - { 652 - name: delete_one_word_backward 653 - modifier: control 654 - keycode: char_w 655 - mode: [emacs, vi_insert] 656 - event: {edit: backspaceword} 657 - } 658 - { 659 - name: move_left 660 - modifier: none 661 - keycode: backspace 662 - mode: vi_normal 663 - event: {edit: moveleft} 664 - } 665 - { 666 - name: newline_or_run_command 667 - modifier: none 668 - keycode: enter 669 - mode: emacs 670 - event: {send: enter} 671 - } 672 - { 673 - name: move_left 674 - modifier: control 675 - keycode: char_b 676 - mode: emacs 677 - event: { 678 - until: [ 679 - {send: menuleft} 680 - {send: left} 681 - ] 682 - } 683 - } 684 - { 685 - name: move_right_or_take_history_hint 686 - modifier: control 687 - keycode: char_f 688 - mode: emacs 689 - event: { 690 - until: [ 691 - {send: historyhintcomplete} 692 - {send: menuright} 693 - {send: right} 694 - ] 695 - } 696 - } 697 - { 698 - name: redo_change 699 - modifier: control 700 - keycode: char_g 701 - mode: emacs 702 - event: {edit: redo} 703 - } 704 - { 705 - name: undo_change 706 - modifier: control 707 - keycode: char_z 708 - mode: emacs 709 - event: {edit: undo} 710 - } 711 - { 712 - name: paste_before 713 - modifier: control 714 - keycode: char_y 715 - mode: emacs 716 - event: {edit: pastecutbufferbefore} 717 - } 718 - { 719 - name: cut_word_left 720 - modifier: control 721 - keycode: char_w 722 - mode: emacs 723 - event: {edit: cutwordleft} 724 - } 725 - { 726 - name: cut_line_to_end 727 - modifier: control 728 - keycode: char_k 729 - mode: emacs 730 - event: {edit: cuttoend} 731 - } 732 - { 733 - name: cut_line_from_start 734 - modifier: control 735 - keycode: char_u 736 - mode: emacs 737 - event: {edit: cutfromstart} 738 - } 739 - { 740 - name: swap_graphemes 741 - modifier: control 742 - keycode: char_t 743 - mode: emacs 744 - event: {edit: swapgraphemes} 745 - } 746 - { 747 - name: move_one_word_left 748 - modifier: alt 749 - keycode: left 750 - mode: emacs 751 - event: {edit: movewordleft} 752 - } 753 - { 754 - name: move_one_word_right_or_take_history_hint 755 - modifier: alt 756 - keycode: right 757 - mode: emacs 758 - event: { 759 - until: [ 760 - {send: historyhintwordcomplete} 761 - {edit: movewordright} 762 - ] 763 - } 764 - } 765 - { 766 - name: move_one_word_left 767 - modifier: alt 768 - keycode: char_b 769 - mode: emacs 770 - event: {edit: movewordleft} 771 - } 772 - { 773 - name: move_one_word_right_or_take_history_hint 774 - modifier: alt 775 - keycode: char_f 776 - mode: emacs 777 - event: { 778 - until: [ 779 - {send: historyhintwordcomplete} 780 - {edit: movewordright} 781 - ] 782 - } 783 - } 784 - { 785 - name: delete_one_word_forward 786 - modifier: alt 787 - keycode: delete 788 - mode: emacs 789 - event: {edit: deleteword} 790 - } 791 - { 792 - name: delete_one_word_backward 793 - modifier: alt 794 - keycode: backspace 795 - mode: emacs 796 - event: {edit: backspaceword} 797 - } 798 - { 799 - name: delete_one_word_backward 800 - modifier: alt 801 - keycode: char_m 802 - mode: emacs 803 - event: {edit: backspaceword} 804 - } 805 - { 806 - name: cut_word_to_right 807 - modifier: alt 808 - keycode: char_d 809 - mode: emacs 810 - event: {edit: cutwordright} 811 - } 812 - { 813 - name: upper_case_word 814 - modifier: alt 815 - keycode: char_u 816 - mode: emacs 817 - event: {edit: uppercaseword} 818 - } 819 - { 820 - name: lower_case_word 821 - modifier: alt 822 - keycode: char_l 823 - mode: emacs 824 - event: {edit: lowercaseword} 825 - } 826 - { 827 - name: capitalize_char 828 - modifier: alt 829 - keycode: char_c 830 - mode: emacs 831 - event: {edit: capitalizechar} 832 - } 833 - { 834 - name: copy_selection 835 - modifier: control_shift 836 - keycode: char_c 837 - mode: emacs 838 - event: { edit: copyselection } 839 - } 840 - { 841 - name: cut_selection 842 - modifier: control_shift 843 - keycode: char_x 844 - mode: emacs 845 - event: { edit: cutselection } 846 - } 847 - { 848 - name: select_all 849 - modifier: control_shift 850 - keycode: char_a 851 - mode: emacs 852 - event: { edit: selectall } 853 - } 854 - { 855 - name: paste 856 - modifier: control_shift 857 - keycode: char_v 858 - mode: emacs 859 - event: { edit: pastecutbufferbefore } 860 - } 861 - ] 862 - } 863 - 864 - # Load Starship prompt 865 - use ~/.cache/starship/init.nu
-41
config/nushell/env.nu
··· 1 - # Nushell Environment Config File 2 - # 3 - # version = "0.90.2" 4 - 5 - $env.ENV_CONVERSIONS = { 6 - "PATH": { 7 - from_string: { |s| $s | split row (char esep) | path expand --no-symlink } 8 - to_string: { |v| $v | path expand --no-symlink | str join (char esep) } 9 - } 10 - } 11 - 12 - let custom_paths = [ 13 - ([$env.HOME ".local/bin"] | path join) 14 - ([$env.HOME ".cargo/bin"] | path join) 15 - ([$env.HOME "bin"] | path join) 16 - ] 17 - 18 - # Directories to search for scripts when calling source or use 19 - # The default for this is $nu.default-config-dir/scripts 20 - $env.NU_LIB_DIRS = [ 21 - ($nu.default-config-dir | path join 'scripts') # add <nushell-config-dir>/scripts 22 - ] 23 - 24 - # Directories to search for plugin binaries when calling register 25 - # The default for this is $nu.default-config-dir/plugins 26 - $env.NU_PLUGIN_DIRS = [ 27 - ($nu.default-config-dir | path join 'plugins') # add <nushell-config-dir>/plugins 28 - ] 29 - 30 - $env.PATH = ($env.PATH | split row (char esep) | prepend $custom_paths) 31 - 32 - # The prompt indicators are environmental variables that represent 33 - # the state of the prompt 34 - $env.PROMPT_INDICATOR = "" 35 - $env.PROMPT_INDICATOR_VI_INSERT = ": " 36 - $env.PROMPT_INDICATOR_VI_NORMAL = "〉" 37 - $env.PROMPT_MULTILINE_INDICATOR = "::: " 38 - 39 - $env.EDITOR = "hx" 40 - 41 - $env.BAT_THEME = "ansi" # basic bitch...
-54
config/nushell/mise.nu
··· 1 - export-env { 2 - $env.MISE_SHELL = "nu" 3 - add-hook pre_prompt { 4 - condition: { "MISE_SHELL" in $env } 5 - code: { mise_hook } 6 - } 7 - add-hook env_change.PWD { 8 - condition: { "MISE_SHELL" in $env } 9 - code: { mise_hook } 10 - } 11 - } 12 - 13 - def --env add-hook [field hook] { 14 - let field = $field | split row . | prepend hooks | into cell-path 15 - let hooks = $env.config | get --ignore-errors $field | default [] 16 - $env.config = ($env.config | upsert $field ($hooks ++ $hook)) 17 - } 18 - 19 - def "parse vars" [] { 20 - $in | lines | parse "{op},{name},{value}" 21 - } 22 - 23 - export def --wrapped main [command?: string, --help, ...rest: string] { 24 - let commands = ["shell", "deactivate"] 25 - 26 - if ($command == null) { 27 - ^"/opt/homebrew/bin/mise" 28 - } else if ($command == "activate") { 29 - $env.MISE_SHELL = "nu" 30 - } else if ($command in $commands) { 31 - ^"/opt/homebrew/bin/mise" $command ...$rest 32 - | parse vars 33 - | update-env 34 - } else { 35 - ^"/opt/homebrew/bin/mise" $command ...$rest 36 - } 37 - } 38 - 39 - def --env "update-env" [] { 40 - for $var in $in { 41 - if $var.op == "set" { 42 - load-env {($var.name): $var.value} 43 - } else if $var.op == "hide" { 44 - hide-env $var.name 45 - } 46 - } 47 - } 48 - 49 - def --env mise_hook [] { 50 - ^"/usr/bin/env" mise hook-env -s nu 51 - | parse vars 52 - | update-env 53 - } 54 -
+1 -1
resources/scripts/bin/change-wallpaper
··· 1 1 #!/usr/bin/env nu 2 2 3 - use vlog 3 + use ../lib/vlog 4 4 5 5 let WALLPAPER_LOCATION = $"($env.HOME)/.cache/current_wallpaper" 6 6 let LOCK_WALLPAPER_LOCATION = $"($env.HOME)/.cache/hyprlock_wallpaper.jpg"
+1 -1
resources/scripts/bin/manage-system
··· 1 1 #!/usr/bin/env nu 2 2 3 - use vlog 3 + use ../lib/vlog 4 4 5 5 let FLAKE_DIR = $"($env.HOME)/Code/dotfiles" 6 6 let SYSTEM_NAME = "starlight"
+1 -1
resources/scripts/bin/screen-lock
··· 1 1 #!/usr/bin/env nu 2 2 3 - use vlog 3 + use ../lib/vlog 4 4 5 5 def lock [] { 6 6 if (pidof hyprlock | complete).exit_code == 0 {