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