~repos /config

#brew#nushell

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

Common configuration


5ab4d00f Peter John

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