dotfiles/.config/nushell/config.nu.cgt

75 lines
1.7 KiB
Text
Raw Normal View History

2024-07-14 19:07:29 +02:00
let completer = {|spans|
fish --command $'complete "--do-complete=($spans | str join " ")"'
| $"value(char tab)description(char newline)" + $in
| from tsv --flexible --no-infer
2024-07-14 19:07:29 +02:00
| each { |comp|
let escaped = $comp.value | str replace --all '"' '\"'
{
value: (if ($escaped | str contains " ") { $'"($escaped)"' } else { $escaped })
description: $comp.description
}
}
}
2024-05-09 14:55:59 +02:00
$env.config = {
show_banner: false
table: {
mode: reinforced
padding: { left: 0, right: 0 }
header_on_separator: true
}
completions: {
2024-07-14 19:07:29 +02:00
algorithm: "fuzzy"
external: (if (which fish | is-not-empty) { {
enable: true
2024-07-14 19:07:29 +02:00
completer: $completer
} } else { {} })
2024-05-09 14:55:59 +02:00
}
cursor_shape: {
vi_insert: line
vi_normal: block
}
2024-09-10 18:58:36 +02:00
shell_integration: {
osc2: true # title
osc7: true # path
osc133: true # location markers for fancy terminals
}
2024-05-09 14:55:59 +02:00
edit_mode: vi
use_kitty_protocol: true
highlight_resolved_externals: true
2024-05-09 22:42:13 +02:00
history: {
file_format: "sqlite"
isolation: true
}
keybindings: [
{
name: new_line_shift
modifier: shift
keycode: enter
mode: vi_insert
event: { edit: insertnewline }
},
]
}
2024-06-18 18:14:17 +02:00
<!
local prefix = ".config/nushell/conf.d/"
local dropins = {}
for f in cg.fileIter() do
if f.path:find(prefix, 1, true) == 1 then
table.insert(dropins, f.path:sub(#prefix))
end
end
table.sort(dropins, function(a, b) return a < b end)
!>
<! for _, d in ipairs(dropins) do !>
source conf.d<% d %>
<! end !>