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

74 lines
1.7 KiB
Text

let completer = {|spans|
fish --command $'complete "--do-complete=($spans | str join " ")"'
| $"value(char tab)description(char newline)" + $in
| from tsv --flexible --no-infer
| each { |comp|
let escaped = $comp.value | str replace --all '"' '\"'
{
value: (if ($escaped | str contains " ") { $'"($escaped)"' } else { $escaped })
description: $comp.description
}
}
}
$env.config = {
show_banner: false
table: {
mode: reinforced
padding: { left: 0, right: 0 }
header_on_separator: true
}
completions: {
algorithm: "fuzzy"
external: (if (which fish | is-not-empty) { {
enable: true
completer: $completer
} } else { {} })
}
cursor_shape: {
vi_insert: line
vi_normal: block
}
shell_integration: {
osc2: true # title
osc7: true # path
osc133: true # location markers for fancy terminals
}
edit_mode: vi
use_kitty_protocol: true
highlight_resolved_externals: true
history: {
file_format: "sqlite"
isolation: true
}
keybindings: [
{
name: new_line_shift
modifier: shift
keycode: enter
mode: vi_insert
event: { edit: insertnewline }
},
]
}
<!
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 !>