1source ~/.zoxide.nu
2source ~/.cache/starship/init.nu
3
4source /home/thehedgehog/.cache/starship/init.nu
5
6let-env config = ($env | default {} config).config
7let-env config = ($env.config | default {} hooks)
8let-env config = ($env.config | update hooks ($env.config.hooks | default [] pre_prompt))
9let-env config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append {
10 code: "
11 let direnv = (direnv export json | from json)
12 let direnv = if ($direnv | length) == 1 { $direnv } else { {} }
13 $direnv | load-env
14 "
15}))
16
17let-env config = {
18 ls: {
19 use_ls_colors: true # use the LS_COLORS environment variable to colorize output
20 clickable_links: true # enable or disable clickable links. Your terminal has to support links.
21 }
22 rm: {
23 always_trash: false # always act as if -t was given. Can be overridden with -p
24 }
25 cd: {
26 abbreviations: false # allows `cd s/o/f` to expand to `cd some/other/folder`
27 }
28 table: {
29 mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
30 index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
31 trim: {
32 methodology: wrapping # wrapping or truncating
33 wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
34 truncating_suffix: "..." # A suffix used by the 'truncating' methodology
35 }
36 }
37
38 explore: {
39 help_banner: true
40 exit_esc: true
41
42 command_bar_text: '#C4C9C6'
43 # command_bar: {fg: '#C4C9C6' bg: '#223311' }
44
45 status_bar_background: {fg: '#1D1F21' bg: '#C4C9C6' }
46 # status_bar_text: {fg: '#C4C9C6' bg: '#223311' }
47
48 highlight: {bg: 'yellow' fg: 'black' }
49
50 status: {
51 # warn: {bg: 'yellow', fg: 'blue'}
52 # error: {bg: 'yellow', fg: 'blue'}
53 # info: {bg: 'yellow', fg: 'blue'}
54 }
55
56 try: {
57 # border_color: 'red'
58 # highlighted_color: 'blue'
59
60 # reactive: false
61 }
62
63 table: {
64 split_line: '#404040'
65
66 cursor: true
67
68 line_index: true
69 line_shift: true
70 line_head_top: true
71 line_head_bottom: true
72
73 show_head: true
74 show_index: true
75
76 # selected_cell: {fg: 'white', bg: '#777777'}
77 # selected_row: {fg: 'yellow', bg: '#C1C2A3'}
78 # selected_column: blue
79
80 # padding_column_right: 2
81 # padding_column_left: 2
82
83 # padding_index_left: 2
84 # padding_index_right: 1
85 }
86
87 config: {
88 cursor_color: {bg: 'yellow' fg: 'black' }
89
90 # border_color: white
91 # list_color: green
92 }
93 }
94
95 history: {
96 max_size: 10000 # Session has to be reloaded for this to take effect
97 sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file
98 file_format: "plaintext" # "sqlite" or "plaintext"
99 }
100 completions: {
101 case_sensitive: false # set to true to enable case-sensitive completions
102 quick: true # set this to false to prevent auto-selecting completions when only one remains
103 partial: true # set this to false to prevent partial filling of the prompt
104 algorithm: "prefix" # prefix or fuzzy
105 external: {
106 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 my be very slow
107 max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
108 completer: null # check 'carapace_completer' above as an example
109 }
110 }
111 filesize: {
112 metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
113 format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
114 }
115 cursor_shape: {
116 emacs: line # block, underscore, line (line is the default)
117 vi_insert: block # block, underscore, line (block is the default)
118 vi_normal: underscore # block, underscore, line (underscore is the default)
119 }
120 color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme`
121 use_grid_icons: true
122 footer_mode: "25" # always, never, number_of_rows, auto
123 float_precision: 2 # the precision for displaying floats in tables
124 # buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
125 use_ansi_coloring: true
126 edit_mode: emacs # emacs, vi
127 shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
128 # true or false to enable or disable the welcome banner at startup
129 show_banner: true
130 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.
131
132 hooks: {
133 pre_prompt: [{
134 null # replace with source code to run before the prompt is shown
135 }]
136 pre_execution: [{
137 null # replace with source code to run before the repl input is run
138 }]
139 env_change: {
140 PWD: [{|before, after|
141 null # replace with source code to run if the PWD environment is different since the last repl input
142 }]
143 }
144 display_output: {
145 if (term size).columns >= 100 { table -e } else { table }
146 }
147 }
148 menus: [
149 # Configuration for default nushell menus
150 # Note the lack of source parameter
151 {
152 name: completion_menu
153 only_buffer_difference: false
154 marker: "| "
155 type: {
156 layout: columnar
157 columns: 4
158 col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
159 col_padding: 2
160 }
161 style: {
162 text: green
163 selected_text: green_reverse
164 description_text: yellow
165 }
166 }
167 {
168 name: history_menu
169 only_buffer_difference: true
170 marker: "? "
171 type: {
172 layout: list
173 page_size: 10
174 }
175 style: {
176 text: green
177 selected_text: green_reverse
178 description_text: yellow
179 }
180 }
181 {
182 name: help_menu
183 only_buffer_difference: true
184 marker: "? "
185 type: {
186 layout: description
187 columns: 4
188 col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
189 col_padding: 2
190 selection_rows: 4
191 description_rows: 10
192 }
193 style: {
194 text: green
195 selected_text: green_reverse
196 description_text: yellow
197 }
198 }
199 # Example of extra menus created using a nushell source
200 # Use the source field to create a list of records that populates
201 # the menu
202 {
203 name: commands_menu
204 only_buffer_difference: false
205 marker: "# "
206 type: {
207 layout: columnar
208 columns: 4
209 col_width: 20
210 col_padding: 2
211 }
212 style: {
213 text: green
214 selected_text: green_reverse
215 description_text: yellow
216 }
217 source: { |buffer, position|
218 $nu.scope.commands
219 | where name =~ $buffer
220 | each { |it| {value: $it.name description: $it.usage} }
221 }
222 }
223 {
224 name: vars_menu
225 only_buffer_difference: true
226 marker: "# "
227 type: {
228 layout: list
229 page_size: 10
230 }
231 style: {
232 text: green
233 selected_text: green_reverse
234 description_text: yellow
235 }
236 source: { |buffer, position|
237 $nu.scope.vars
238 | where name =~ $buffer
239 | sort-by name
240 | each { |it| {value: $it.name description: $it.type} }
241 }
242 }
243 {
244 name: commands_with_description
245 only_buffer_difference: true
246 marker: "# "
247 type: {
248 layout: description
249 columns: 4
250 col_width: 20
251 col_padding: 2
252 selection_rows: 4
253 description_rows: 10
254 }
255 style: {
256 text: green
257 selected_text: green_reverse
258 description_text: yellow
259 }
260 source: { |buffer, position|
261 $nu.scope.commands
262 | where name =~ $buffer
263 | each { |it| {value: $it.name description: $it.usage} }
264 }
265 }
266 ]
267 keybindings: [
268 {
269 name: completion_menu
270 modifier: none
271 keycode: tab
272 mode: [emacs vi_normal vi_insert]
273 event: {
274 until: [
275 { send: menu name: completion_menu }
276 { send: menunext }
277 ]
278 }
279 }
280 {
281 name: completion_previous
282 modifier: shift
283 keycode: backtab
284 mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list
285 event: { send: menuprevious }
286 }
287 {
288 name: history_menu
289 modifier: control
290 keycode: char_r
291 mode: emacs
292 event: { send: menu name: history_menu }
293 }
294 {
295 name: next_page
296 modifier: control
297 keycode: char_x
298 mode: emacs
299 event: { send: menupagenext }
300 }
301 {
302 name: undo_or_previous_page
303 modifier: control
304 keycode: char_z
305 mode: emacs
306 event: {
307 until: [
308 { send: menupageprevious }
309 { edit: undo }
310 ]
311 }
312 }
313 {
314 name: yank
315 modifier: control
316 keycode: char_y
317 mode: emacs
318 event: {
319 until: [
320 {edit: pastecutbufferafter}
321 ]
322 }
323 }
324 {
325 name: unix-line-discard
326 modifier: control
327 keycode: char_u
328 mode: [emacs, vi_normal, vi_insert]
329 event: {
330 until: [
331 {edit: cutfromlinestart}
332 ]
333 }
334 }
335 {
336 name: kill-line
337 modifier: control
338 keycode: char_k
339 mode: [emacs, vi_normal, vi_insert]
340 event: {
341 until: [
342 {edit: cuttolineend}
343 ]
344 }
345 }
346 # Keybindings used to trigger the user defined menus
347 {
348 name: commands_menu
349 modifier: control
350 keycode: char_t
351 mode: [emacs, vi_normal, vi_insert]
352 event: { send: menu name: commands_menu }
353 }
354 {
355 name: vars_menu
356 modifier: alt
357 keycode: char_o
358 mode: [emacs, vi_normal, vi_insert]
359 event: { send: menu name: vars_menu }
360 }
361 {
362 name: commands_with_description
363 modifier: control
364 keycode: char_s
365 mode: [emacs, vi_normal, vi_insert]
366 event: { send: menu name: commands_with_description }
367 }
368 ]
369}