aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/bat
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tools/bat')
-rw-r--r--modules/tools/bat/default.nix22
-rw-r--r--modules/tools/bat/theme.mustache.tmTheme120
2 files changed, 142 insertions, 0 deletions
diff --git a/modules/tools/bat/default.nix b/modules/tools/bat/default.nix
new file mode 100644
index 0000000..d459042
--- /dev/null
+++ b/modules/tools/bat/default.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }:
+
+{
+ options.tools.bat = {
+ enable = lib.mkEnableOption "Enables bat.";
+ };
+
+ config = lib.mkIf config.tools.bat.enable {
+ programs.bat.enable = true;
+ programs.bat.config = {
+ tabs = "4";
+ theme = "custom-theme";
+ };
+ # shell.alias."cat" = "${pkgs.bat}/bin/bat -pp";
+ # shell.alias."less" = "${pkgs.bat}/bin/bat --paging always";
+ # home.sessionVariables."PAGER" = "${pkgs.bat}/bin/bat --paging always";
+ xdg.configFile."bat/themes/custom-theme.tmTheme".source
+ = config.scheme {
+ template = builtins.readFile ./theme.mustache.tmTheme;
+ };
+ };
+}
diff --git a/modules/tools/bat/theme.mustache.tmTheme b/modules/tools/bat/theme.mustache.tmTheme
new file mode 100644
index 0000000..844b80d
--- /dev/null
+++ b/modules/tools/bat/theme.mustache.tmTheme
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>customTheme</string>
+ <key>settings</key>
+ <array>
+ <!-- General Colors -->
+ <dict>
+ <key>settings</key>
+ <dict>
+ <key>background</key>
+ <string>#{{base00-hex}}</string>
+ <key>foreground</key>
+ <string>#{{base05-hex}}</string>
+ <key>caret</key>
+ <string>#{{base07-hex}}</string>
+ <key>invisibles</key>
+ <string>#{{base03-hex}}</string>
+ <key>lineHighlight</key>
+ <string>#{{base02-hex}}</string>
+ <key>selection</key>
+ <string>#{{base03-hex}}</string>
+ </dict>
+ </dict>
+
+ <!-- Syntax-Specific Colors -->
+ <dict>
+ <key>scope</key>
+ <string>comment</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base04-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>string</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0A-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>constant.numeric</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base09-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>variable</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base08-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>keyword</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0D-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>support.function</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0E-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>constant.language</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0B-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>entity.name.tag</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0C-hex}}</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>scope</key>
+ <string>invalid</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#{{base0F-hex}}</string>
+ </dict>
+ </dict>
+ </array>
+</dict>
+</plist>
+