feat(bat): Add fish config

This commit is contained in:
punkfairie 2024-10-29 20:13:02 -07:00
parent 927f573873
commit 935af00f81

View file

@ -1,4 +1,9 @@
{pkgs, ...}: {
{
pkgs,
config,
lib,
...
}: {
programs.bat = {
enable = true;
@ -13,4 +18,45 @@
style = "auto";
};
};
programs.fish = lib.mkIf config.programs.fish.enable {
interactiveShellInit = ''
set -gx BATDIFF_USE_DELTA true
'';
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";
};
};
};
}