mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 11:37:44 +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
38
BROKEN.md
38
BROKEN.md
|
@ -9,41 +9,3 @@
|
|||
|
||||
- Nushell custom prompt title does not work, as it gets
|
||||
overriden by the shell integration in a split second.
|
||||
|
||||
- Nix Super errors, saying it expected an attrset and got a
|
||||
trunk when evaluating the non-outputs section. This should
|
||||
work, as it is an advertised feature (And it does! Don't get
|
||||
me wrong, it works if you don't use the builtins namespace)
|
||||
but doesn't work completely. Max is working on a fix, so I've
|
||||
put the soon-to-be attributes here, so I don't forget.
|
||||
|
||||
```nix
|
||||
nixConfig = with builtins; mapAttrs (name: concatStringsSep " ") {
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org/"
|
||||
"https://hyprland.cachix.org/"
|
||||
"https://cache.privatevoid.net/"
|
||||
];
|
||||
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"hyprland.cachix.org:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg="
|
||||
];
|
||||
};
|
||||
|
||||
inputs = with builtins; mapAttrs (name: url: {
|
||||
url = "git+https://${url}";
|
||||
} // (if elem name [ "nixSuper" "hyprland" "hyprpicker" ] then {} else {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
})) {
|
||||
nixSuper = "github.com/privatevoid-net/nix-super";
|
||||
nixpkgs = "github.com/NixOS/nixpkgs/tree/nixos-unstable";
|
||||
homeManager = "github.com/nix-community/home-manager";
|
||||
hyprland = "github.com/hyprwm/Hyprland";
|
||||
hyprpicker = "github.com/hyprwm/hyprpicker";
|
||||
fenix = "github.com/nix-community/fenix";
|
||||
tools = "github.com/RGBCube/FlakeTools";
|
||||
themes = "github.com/RGBCube/ThemeNix";
|
||||
};
|
||||
```
|
||||
|
|
|
@ -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