marleyos/home/bat/default.nix

62 lines
1,020 B
Nix

{
pkgs,
config,
lib,
...
}: {
programs.bat = {
enable = true;
extraPackages = with pkgs.bat-extras; [
batdiff
batman
];
rose-pine.enable = true;
config = {
style = "auto";
};
};
home.sessionVariables = lib.mkIf config.home.preferXdgDirectories {
BATDIFF_USE_DELTA = "true";
};
programs.fish = lib.mkIf config.programs.fish.enable {
functions = {
cat = {
wraps = "bat";
body = "bat $argv";
};
cath = {
wraps = "bat";
body = "bat --plain --language=help $argv";
};
};
shellAbbrs = {
B = {
position = "anywhere";
setCursor = true;
expansion = "% | bat";
};
"-h" = {
position = "anywhere";
expansion = "-h | cath";
};
"--help" = {
position = "anywhere";
expansion = "--help | cath";
};
help = {
position = "anywhere";
expansion = "help | cath";
};
};
};
}