1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-31 12:07:48 +00:00

Expand alises when calling fish completer

This commit is contained in:
RGBCube 2024-02-07 08:53:21 +03:00
parent e55715adcb
commit 72110796fa
No known key found for this signature in database
3 changed files with 16 additions and 46 deletions

View file

@ -9,41 +9,3 @@
- Nushell custom prompt title does not work, as it gets - Nushell custom prompt title does not work, as it gets
overriden by the shell integration in a split second. 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";
};
```

View file

@ -15,12 +15,10 @@ systemConfiguration {
package = upkgs.nixSuper; package = upkgs.nixSuper;
registry = (lib.filterAttrs registry = (builtins.mapAttrs
(_: value: value != {}) (_: value: lib.mkIf (value ? sourceInfo) {
(builtins.mapAttrs flake = value;
(_: value: lib.optionalAttrs (value ? sourceInfo) { }) inputs) // { default.flake = inputs.nixpkgs; };
flake = value;
}) inputs)) // { default.flake = inputs.nixpkgs; };
settings.experimental-features = [ settings.experimental-features = [
"auto-allocate-uids" "auto-allocate-uids"

View file

@ -129,7 +129,7 @@ $env.config.history = {
} }
$env.config.completions = { $env.config.completions = {
algorithm: fuzzy algorithm: prefix
case_sensitive: false case_sensitive: false
partial: true partial: true
quick: true quick: true
@ -137,7 +137,17 @@ $env.config.completions = {
enable: true enable: true
max_results: 100 max_results: 100
completer: {|tokens: list<string>| 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 | $"value(char tab)description(char newline)" + $in
| from tsv --flexible --no-infer | from tsv --flexible --no-infer
} }