all repos — nixfiles @ be6236a872079b144d4abdeace1d34b528447136

System and user configuration, managed by nix and home-manager

Enable `bat`
Alan Pearce alan@alanpearce.eu
Fri, 16 Jun 2023 17:03:59 +0200
commit

be6236a872079b144d4abdeace1d34b528447136

parent

1ea3974cd0ac82421d1cbcac4075ab46760ee7cd

2 files changed, 16 insertions(+), 0 deletions(-)

jump to
M user/settings/base.nixuser/settings/base.nix
@@ -13,6 +13,7 @@ html.enable = true;   };
   home.sessionVariables = {
     EMAIL = "alan@alanpearce.eu";
+    MANPAGER = "sh -c 'col -bx | bat -l man -p'";
   };
   xdg = {
     enable = true;
@@ -36,6 +37,16 @@ tree_view = 1;       hide_kernel_threads = 1;
       hide_userland_threads = 1;
     };
+  };
+  programs.bat = {
+    enable = true;
+    extraPackages = with pkgs.bat-extras; [
+      batdiff
+      batman
+      batgrep
+      batpipe
+      prettybat
+    ];
   };
   home.packages = with pkgs;
     [
M user/zsh/zshrcuser/zsh/zshrc
@@ -169,3 +169,8 @@ tere() {   local result=$(command tere "$@")
   [ -n "$result" ] && cd -- "$result"
 }
+
+alias bathelp='bat --plain --language=help'
+help() {
+    "$@" --help 2>&1 | bathelp
+}