1
1
Fork 0

fish: use setCursor for all abbrs

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-02-11 15:17:18 -06:00
parent 6ab6fb3eb5
commit 5ae4cbd0b2
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -19,37 +19,36 @@ in {
inherit enable interactiveShellInit shellAbbrs; inherit enable interactiveShellInit shellAbbrs;
}; };
${config.custom.username}.programs.fish = let ${config.custom.username}.programs.fish = {
# Expand abbreviations anywhere in the shell
#?? sudo ABBREVIATION
anywhere = expansion: {
inherit expansion;
position = "anywhere";
setCursor = true;
};
# Set cursor position to %
#?? % | EXPANSION
cursor = expansion: {
inherit expansion;
setCursor = true;
};
in {
enable = true; enable = true;
shellAbbrs = { shellAbbrs =
"/e" = anywhere "/etc/%"; # Expand abbreviations anywhere in the shell
"/en" = anywhere "/etc/nixos/%"; #?? sudo ABBREVIATION
"/h" = anywhere "~/%"; mapAttrs (name: value: {
"/hd" = anywhere "~/.dev/%"; expansion = value;
"/n" = anywhere "/nix/%"; position = "anywhere";
"/nv" = anywhere "/nix/var/%"; setCursor = true;
"/nvn" = anywhere "/nix/var/nix/%"; }) {
"/nvnp" = anywhere "/nix/var/nix/profiles/%"; "/e" = "/etc/%";
"/nvnps" = anywhere "/nix/var/nix/profiles/system/%"; "/en" = "/etc/nixos/%";
"/r" = anywhere "/run/%"; "/h" = "~/%";
"/rc" = anywhere "/run/current-system/%"; "/hd" = "~/.dev/%";
"/n" = "/nix/%";
"/nv" = "/nix/var/%";
"/nvn" = "/nix/var/nix/%";
"/nvnp" = "/nix/var/nix/profiles/%";
"/nvnps" = "/nix/var/nix/profiles/system/%";
"/r" = "/run/%";
"/rc" = "/run/current-system/%";
}
//
# Set all cursor positions to %
#?? % | EXPANSION
mapAttrs (name: value: {
expansion = value;
setCursor = true;
}) {
reboot = "sudo systemctl reboot"; reboot = "sudo systemctl reboot";
restart = "sudo systemctl reboot"; restart = "sudo systemctl reboot";
poweroff = "sudo systemctl poweroff"; poweroff = "sudo systemctl poweroff";
@ -163,9 +162,12 @@ in {
nfi = "nix flake info"; nfi = "nix flake info";
nfl = "nix flake lock"; nfl = "nix flake lock";
nfu = "nix flake update"; nfu = "nix flake update";
ngl = cursor "nix run github:nix-community/nixGL --impure -- %"; nr = "nix run";
nr = "nix run nixpkgs#"; nrgl = "nix run github:nix-community/nixGL --impure -- %";
ns = "nix shell nixpkgs#"; nrn = "nix run nixpkgs#%";
ns = "nix shell";
nsgl = "nix shell github:nix-community/nixGL --impure";
nsn = "nix shell nixpkgs#%";
nt = "nix store"; nt = "nix store";
no = "nixos"; no = "nixos";