From a738fc02e847addee01167b09cc8334c0bb7e578 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 13 Mar 2023 15:11:51 +0300 Subject: [PATCH] aerc: add more bindigs --- users/modules/mail/default.nix | 128 ++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/users/modules/mail/default.nix b/users/modules/mail/default.nix index 19d9ccd..0d42beb 100644 --- a/users/modules/mail/default.nix +++ b/users/modules/mail/default.nix @@ -1,8 +1,20 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let exec = cmd: ":${cmd}"; fill = cmd: ":${cmd}"; + + globalBinds = { + "gt" = exec "next-tab"; + "gT" = exec "prev-tab"; + }; + + commonMessageBinds = { + "U" = exec "unsubscribe"; + "D" = exec "delete"; + "A" = exec "archive flat"; + "mS" = exec "move Junk"; + }; in { accounts.email.maildirBasePath = "${config.xdg.dataHome}/mail"; @@ -27,7 +39,7 @@ in border-char-vertical = "│"; border-char-horizontal = "─"; fuzzy-complete = true; - new-message-bell = false; + new-message-bell = true; }; statusline = { @@ -40,74 +52,72 @@ in }; }; extraBinds = { - messages = { - "q" = exec "quit"; + messages = lib.mkMerge [ + globalBinds + commonMessageBinds + { + "q" = exec "quit"; - "gt" = exec "next-tab"; - "gT" = exec "prev-tab"; + "j" = exec "next"; + "" = exec "next"; + "" = exec "next 50%"; - "j" = exec "next"; - "" = exec "next"; - "" = exec "next 50%"; + "k" = exec "prev"; + "" = exec "prev"; + "" = exec "prev 50%"; - "k" = exec "prev"; - "" = exec "prev"; - "" = exec "prev 50%"; + "gg" = exec "select 0"; + "G" = exec "select -1"; - "gg" = exec "select 0"; - "G" = exec "select -1"; + "J" = exec "next-folder"; + "K" = exec "prev-folder"; + "c" = fill "cf"; - "J" = exec "next-folder"; - "K" = exec "prev-folder"; - "c" = fill "cf"; + "" = exec "view"; + "C" = exec "compose"; - "" = exec "view"; - "C" = exec "compose"; + "/" = fill "search"; + "\\" = fill "filter"; + "n" = exec "next-result"; + "N" = exec "prev-result"; + #"D" = exec "modify-labels +deleted -inbox"; + #"A" = exec "modify-labels -inbox"; + #"ms" = exec "modify-labels +spam -inbox"; + #"mS" = exec "modify-labels -spam +inbox"; + } + ]; - "/" = fill "search"; - "\\" = fill "filter"; - "n" = exec "next-result"; - "N" = exec "prev-result"; + view = lib.mkMerge [ + globalBinds + commonMessageBinds + { + "q" = exec "close"; + "O" = exec "open"; + "S" = fill "save"; - "U" = exec "unsubscribe"; - "D" = exec "delete"; - "A" = exec "archive flat"; - #"D" = exec "modify-labels +deleted -inbox"; - #"A" = exec "modify-labels -inbox"; - #"ms" = exec "modify-labels +spam -inbox"; - #"mS" = exec "modify-labels -spam +inbox"; - }; + "f" = exec "forward"; - view = { - "q" = exec "close"; - "O" = exec "open"; - "S" = fill "save"; + "rr" = exec "reply -a"; + "rq" = exec "reply -aq"; + "Rr" = exec "reply"; + "Rq" = exec "reply -q"; - "f" = exec "forward"; + "" = exec "prev-part"; + "" = exec "next-part"; + "J" = exec "next"; + "K" = exec "prev"; + } + ]; - "rr" = exec "reply -a"; - "rq" = exec "reply -aq"; - "Rr" = exec "reply"; - "Rq" = exec "reply -q"; - - "" = exec "prev-part"; - "" = exec "next-part"; - "J" = exec "next"; - "K" = exec "prev"; - - "U" = exec "unsubscribe"; - "D" = exec "delete"; - "A" = exec "archive flat"; - # "ms" = exec "modify-labels +spam -inbox"; - # "mS" = exec "modify-labels -spam +inbox"; - }; - - compose = { - "$ex" = ""; - "" = exec "prev-field"; - "" = exec "next-field"; - "" = exec "next-field"; - }; + compose = lib.mkMerge [ + globalBinds + { + "$ex" = ""; + "" = exec "prev-field"; + "" = exec "next-field"; + "" = exec "next-field"; + } + ]; "compose::editor" = { "$noinherit" = "true";