nushell: enable fish as a completion source

This commit is contained in:
LordMZTE 2024-07-12 17:43:14 +02:00
parent e3819ca789
commit b575bebe13
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -1,3 +1,10 @@
# See: https://www.nushell.sh/cookbook/external_completers.html#fish-completer
let fish_completer = {|spans|
fish --command $'complete "--do-complete=($spans | str join " ")"'
| $"value(char tab)description(char newline)" + $in
| from tsv --flexible --no-infer
}
$env.config = {
show_banner: false
@ -8,7 +15,10 @@ $env.config = {
}
completions: {
algorithm: "fuzzy"
external: (if (which fish | is-not-empty) { {
enable: true
completer: $fish_completer
} } else { {} })
}
cursor_shape: {