forked from DustVoice/dotfiles
Conditional completer (use fish on linux)
This commit is contained in:
parent
7702ac9e9c
commit
001d629035
1 changed files with 6 additions and 1 deletions
|
@ -181,6 +181,11 @@ let carapace_completer = {|spans|
|
||||||
carapace $spans.0 nushell $spans | from json
|
carapace $spans.0 nushell $spans | from json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let fish_completer = {|spans|
|
||||||
|
fish --command $'complete "--do-complete=($spans | str join " ")"'
|
||||||
|
| $"value(char tab)description(char newline)" + $in
|
||||||
|
| from tsv --flexible --no-infer
|
||||||
|
}
|
||||||
|
|
||||||
# The default config record. This is where much of your global configuration is setup.
|
# The default config record. This is where much of your global configuration is setup.
|
||||||
let-env config = {
|
let-env config = {
|
||||||
|
@ -278,7 +283,7 @@ let-env config = {
|
||||||
external: {
|
external: {
|
||||||
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
|
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
|
||||||
max_results: 50 # setting it lower can improve completion performance at the cost of omitting some options
|
max_results: 50 # setting it lower can improve completion performance at the cost of omitting some options
|
||||||
completer: $carapace_completer # check 'carapace_completer' above as an example
|
completer: (if ("OS" not-in $env) or (not $env.OS == "Windows_NT") { $fish_completer } else { $carapace_completer }) # check 'carapace_completer' above as an example
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filesize: {
|
filesize: {
|
||||||
|
|
Loading…
Reference in a new issue