summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-06-16 17:03:59 +0200
committerAlan Pearce2023-06-16 17:03:59 +0200
commitbe6236a872079b144d4abdeace1d34b528447136 (patch)
treee3bf9def5a4aca8dcda8fd07055e18bbe5962019
parent1ea3974cd0ac82421d1cbcac4075ab46760ee7cd (diff)
downloadnixfiles-be6236a872079b144d4abdeace1d34b528447136.tar.lz
nixfiles-be6236a872079b144d4abdeace1d34b528447136.tar.zst
nixfiles-be6236a872079b144d4abdeace1d34b528447136.zip
Enable `bat`
-rw-r--r--user/settings/base.nix11
-rw-r--r--user/zsh/zshrc5
2 files changed, 16 insertions, 0 deletions
diff --git a/user/settings/base.nix b/user/settings/base.nix
index 6f86a33e..d447d456 100644
--- a/user/settings/base.nix
+++ b/user/settings/base.nix
@@ -13,6 +13,7 @@
   };
   home.sessionVariables = {
     EMAIL = "alan@alanpearce.eu";
+    MANPAGER = "sh -c 'col -bx | bat -l man -p'";
   };
   xdg = {
     enable = true;
@@ -37,6 +38,16 @@
       hide_userland_threads = 1;
     };
   };
+  programs.bat = {
+    enable = true;
+    extraPackages = with pkgs.bat-extras; [
+      batdiff
+      batman
+      batgrep
+      batpipe
+      prettybat
+    ];
+  };
   home.packages = with pkgs;
     [
       pv
diff --git a/user/zsh/zshrc b/user/zsh/zshrc
index 2c87e5a7..0331a083 100644
--- a/user/zsh/zshrc
+++ b/user/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
+}