marleyos/home/programs/bat.nix

70 lines
1.1 KiB
Nix
Raw Normal View History

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