mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Switch to the ls clone eza
This commit is contained in:
parent
89deb74890
commit
56da6f8ae2
1 changed files with 40 additions and 14 deletions
|
|
@ -7,25 +7,51 @@
|
|||
options.myConfig.shell.enhancement.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.shell.enhancement.enable {
|
||||
programs.lsd = {
|
||||
enable = true;
|
||||
enableAliases = true;
|
||||
};
|
||||
|
||||
home.shellAliases.cat = let
|
||||
theme =
|
||||
{
|
||||
dark = "";
|
||||
light = "GitHub";
|
||||
}
|
||||
."${config.myConfig.de.theme}";
|
||||
in "${lib.getExe pkgs.bat} --plain --theme=${theme}";
|
||||
|
||||
programs.fzf.enable = true;
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
options = ["--cmd cd"];
|
||||
};
|
||||
|
||||
home.shellAliases = let
|
||||
lsAliases = let
|
||||
list = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary";
|
||||
flagCombos = lib.crossLists (a: b: "${a}${b}") [["" "a"] ["" "d" "f"]];
|
||||
getFlags = str:
|
||||
lib.concatStringsSep " " (lib.forEach (lib.stringToCharacters str) (x:
|
||||
{
|
||||
a = "--all";
|
||||
d = "--only-dirs";
|
||||
f = "--only-files";
|
||||
}
|
||||
.${x}));
|
||||
flaggedAliases = lib.concatMapAttrs (name: value: {
|
||||
"l${name}" = "l ${value}";
|
||||
"ll${name}" = "ll ${value}";
|
||||
"lt${name}" = "lt ${value}";
|
||||
}) (lib.genAttrs flagCombos (str: "${getFlags str}"));
|
||||
in
|
||||
flaggedAliases
|
||||
// {
|
||||
ls = "l";
|
||||
l = "${list} --oneline --dereference";
|
||||
ll = "${list} --long";
|
||||
lt = "${list} --tree";
|
||||
};
|
||||
|
||||
catAlias = let
|
||||
theme =
|
||||
{
|
||||
dark = "";
|
||||
light = "GitHub";
|
||||
}
|
||||
."${config.myConfig.de.theme}";
|
||||
in {cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";};
|
||||
in
|
||||
lib.mkMerge [
|
||||
lsAliases
|
||||
catAlias
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue