marleyos/modules/home/programs/bat.nix
2025-05-26 18:41:37 -07:00

68 lines
1.1 KiB
Nix

{
config,
lib,
...
}: let
cfg = config.marleyos.programs.bat;
in {
options.marleyos.programs.bat.enable = lib.mkEnableOption "bat";
config = lib.mkIf cfg.enable {
programs.bat = {
enable = true;
config = {
style = "auto";
};
};
programs.fish = {
functions = {
cat = {
wraps = "bat";
body =
# fish
"bat $argv";
};
cath = {
wraps = "bat";
body =
# fish
"bat --plain --language=help $argv";
};
};
};
home.shellAbbrs = {
B = {
position = "anywhere";
setCursor = true;
expansion =
# fish
"% | bat";
};
"-h" = {
position = "anywhere";
expansion =
# fish
"-h | cath";
};
"--help" = {
position = "anywhere";
expansion =
# fish
"--help | cath";
};
help = {
position = "anywhere";
expansion =
# fish
"help | cath";
};
};
};
}