config

#brew#nushell

git clone https://git.pyrossh.dev/config

Common configuration


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