mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 19:47:47 +00:00
Expand alises when calling fish completer
This commit is contained in:
parent
e55715adcb
commit
72110796fa
3 changed files with 16 additions and 46 deletions
|
@ -15,12 +15,10 @@ systemConfiguration {
|
|||
|
||||
package = upkgs.nixSuper;
|
||||
|
||||
registry = (lib.filterAttrs
|
||||
(_: value: value != {})
|
||||
(builtins.mapAttrs
|
||||
(_: value: lib.optionalAttrs (value ? sourceInfo) {
|
||||
flake = value;
|
||||
}) inputs)) // { default.flake = inputs.nixpkgs; };
|
||||
registry = (builtins.mapAttrs
|
||||
(_: value: lib.mkIf (value ? sourceInfo) {
|
||||
flake = value;
|
||||
}) inputs) // { default.flake = inputs.nixpkgs; };
|
||||
|
||||
settings.experimental-features = [
|
||||
"auto-allocate-uids"
|
||||
|
|
|
@ -129,7 +129,7 @@ $env.config.history = {
|
|||
}
|
||||
|
||||
$env.config.completions = {
|
||||
algorithm: fuzzy
|
||||
algorithm: prefix
|
||||
case_sensitive: false
|
||||
partial: true
|
||||
quick: true
|
||||
|
@ -137,7 +137,17 @@ $env.config.completions = {
|
|||
enable: true
|
||||
max_results: 100
|
||||
completer: {|tokens: list<string>|
|
||||
fish --command $'complete (char sq)--do-complete=($tokens | str join " ")(char sq)'
|
||||
mut expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
||||
|
||||
mut expanded = if $expanded != null {
|
||||
$expanded | split row " " | append ($tokens | skip 1)
|
||||
} else {
|
||||
$tokens
|
||||
}
|
||||
|
||||
$expanded.0 = ($expanded.0 | str trim --left --char "^")
|
||||
|
||||
fish --command $'complete (char sq)--do-complete=($expanded | str join " ")(char sq)'
|
||||
| $"value(char tab)description(char newline)" + $in
|
||||
| from tsv --flexible --no-infer
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue