From 442df7a3962662458c8297bc3db313be79462c9b Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Fri, 6 Jun 2025 17:16:55 -0400 Subject: modules/aerc: init --- modules/aerc.nix | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 modules/aerc.nix (limited to 'modules/aerc.nix') diff --git a/modules/aerc.nix b/modules/aerc.nix new file mode 100644 index 0000000..f799588 --- /dev/null +++ b/modules/aerc.nix @@ -0,0 +1,150 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.modules.aerc; +in +{ + options.modules.aerc = { + enable = lib.mkEnableOption "aerc"; + }; + config = lib.mkIf cfg.enable { + programs.aerc = { + enable = true; + extraConfig = { + general = { + unsafe-accounts-conf = true; + default-menu-cmd = "fzf --tmux"; + }; + ui.sidebar-width = 0; + filters = { + "text/plain" = "colorize"; + }; + viewer = { + pager = "nvim +Man!"; + }; + }; + extraBinds = { + global = { + "\\[t" = ":prev-tab"; + "\\]t" = ":next-tab"; + "" = ":term"; + "?" = ":help keys"; + "" = ":prompt 'Quit?' quit"; + "" = ":prompt 'Quit?' quit"; + "" = ":suspend"; + }; + + "messages:folder=Drafts"."" = ":recall"; + messages = { + /*** CUSTOM SECTION ***/ + "n" = ":next"; + "e" = ":prev"; + N = ":next-folder"; + E = ":prev-folder"; + j = ":next-result"; + J = ":prev-result"; + /*** ***/ + g = ":select 0"; + G = ":select -1"; + + "T" = ":toggle-threads"; + "zc" = ":fold"; + "zo" = ":unfold"; + "za" = ":fold -t"; + "zM" = ":fold -a"; + "zR" = ":unfold -a"; + "" = ":fold -t"; + "" = ":view"; + "d" = ":choose -o y 'Really delete this message' delete-message"; + "D" = ":delete"; + "a" = ":archive flat"; + "A" = ":unmark -a:mark -T:archive flat"; + "C" = ":compose"; + "b" = ":bounce"; + + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; + + "c" = ":cf"; + "$" = ":term"; + "!" = ":term"; + "|" = ":pipe"; + + "/" = ":search"; + "\\" = ":filter"; + "" = ":clear"; + + "s" = ":split"; + "S" = ":vsplit"; + + "pl" = ":patch list"; + "pa" = ":patch apply "; + "pd" = ":patch drop "; + "pb" = ":patch rebase"; + "pt" = ":patch term"; + "ps" = ":patch switch "; + }; + view = { + "/" = ":toggle-key-passthrough/"; + "q" = ":close"; + "O" = ":open"; + "o" = ":open"; + "S" = ":save"; + "|" = ":pipe"; + "D" = ":delete"; + "A" = ":archive flat"; + + "" = ":copy-link "; + "" = ":open-link "; + + "f" = ":forward"; + "rr" = ":reply -a"; + "rq" = ":reply -aq"; + "Rr" = ":reply"; + "Rq" = ":reply -q"; + + "H" = ":toggle-headers"; + "" = ":prev-part"; + "" = ":next-part"; + "N" = ":next"; + "E" = ":prev"; + }; + compose = { + "$noinherit" = "true"; + "$ex" = ""; + "$complete" = ""; + "n" = ":next"; + "e" = ":prev"; + "" = ":switch-account -p"; + "" = ":switch-account -n"; + "" = ":next-field"; + "" = ":prev-field"; + "" = ":prev-tab"; + "" = ":prev-tab"; + "" = ":next-tab"; + "" = ":next-tab"; + }; + "compose::review" = { + "y" = ":send"; + "n" = ":abort"; + "s" = ":sign"; + "x" = ":encrypt"; + "v" = ":preview"; + "p" = ":postpone"; + "q" = ":choose -o d discard abort -o p postpone postpone"; + "e" = ":edit"; + "a" = ":attach"; + "d" = ":detach"; + }; + terminal = { + "$noinherit" = "true"; + "$ex" = ""; + "" = ":prev-tab"; + "" = ":next-tab"; + }; + }; + }; + }; +} + -- cgit v1.2.3