# NeoMutt keybindings, grouped by the menu in which they apply. { config, lib, ... }: let bind = keyMap: key: action: { map = keyMap; inherit key action; }; in { config.programs.neomutt.binds = lib.mkIf config.communication.neomutt.enable [ # Index (bind [ "index" ] "$" "noop") (bind [ "index" ] "g" "noop") (bind [ "index" ] "d" "noop") (bind [ "index" ] "z" "noop") (bind [ "index" ] ":" "noop") (bind [ "index" ] "q" "noop") (bind [ "index" ] "\\Ch" "help") # Opening a message is reserved for Enter/Return. (bind [ "index" ] "h" "noop") (bind [ "index" ] "" "noop") (bind [ "index" ] ":q" "exit") (bind [ "index" ] ":w" "sync-mailbox") (bind [ "index" ] "j" "next-entry") (bind [ "index" ] "k" "previous-entry") (bind [ "index" ] "gg" "first-entry") (bind [ "index" ] "G" "last-entry") (bind [ "index" ] "\\Cd" "half-down") (bind [ "index" ] "\\Cu" "half-up") (bind [ "index" ] "\\Cf" "next-page") (bind [ "index" ] "\\Cb" "previous-page") (bind [ "index" ] "/" "search") (bind [ "index" ] "?" "search-reverse") (bind [ "index" ] "n" "search-next") (bind [ "index" ] "N" "search-opposite") (bind [ "index" ] "gf" "limit") (bind [ "index" ] "]" "next-unread") (bind [ "index" ] "[" "previous-unread") (bind [ "index" ] "}" "next-new") (bind [ "index" ] "{" "previous-new") (bind [ "index" ] "za" "collapse-thread") (bind [ "index" ] "zA" "collapse-all") (bind [ "index" ] "\\Ck" "sidebar-prev") (bind [ "index" ] "\\Cj" "sidebar-next") (bind [ "index" ] "\\Co" "sidebar-open") (bind [ "index" ] "\\Cn" "sidebar-toggle-visible") (bind [ "index" ] "m" "mail") (bind [ "index" ] "r" "reply") (bind [ "index" ] "R" "group-reply") (bind [ "index" ] "f" "forward-message") (bind [ "index" ] "c" "change-folder") (bind [ "index" ] "s" "save-message") (bind [ "index" ] "y" "copy-message") (bind [ "index" ] "t" "tag-entry") (bind [ "index" ] "T" "tag-thread") (bind [ "index" ] "gh" "display-toggle-weed") (bind [ "index" ] "dd" "delete-message") (bind [ "index" ] "dT" "delete-thread") (bind [ "index" ] "u" "undelete-message") (bind [ "index" ] "U" "undelete-thread") # Pager # Messages open in Neovim via $pager. These bindings remain useful for # NeoMutt's internal pager, e.g. when it is used by a mailcap viewer. (bind [ "pager" ] "g" "noop") (bind [ "pager" ] "d" "noop") (bind [ "pager" ] ":" "noop") (bind [ "pager" ] "q" "noop") (bind [ "pager" ] "\\Ch" "help") (bind [ "pager" ] ":q" "exit") (bind [ "pager" ] ":w" "sync-mailbox") (bind [ "pager" ] "j" "next-line") (bind [ "pager" ] "k" "previous-line") (bind [ "pager" ] "gg" "top") (bind [ "pager" ] "G" "bottom") (bind [ "pager" ] "\\Cd" "half-down") (bind [ "pager" ] "\\Cu" "half-up") (bind [ "pager" ] "\\Cf" "next-page") (bind [ "pager" ] "\\Cb" "previous-page") (bind [ "pager" ] "/" "search") (bind [ "pager" ] "?" "search-reverse") (bind [ "pager" ] "n" "search-next") (bind [ "pager" ] "N" "search-opposite") (bind [ "pager" ] "\\Ck" "sidebar-prev") (bind [ "pager" ] "\\Cj" "sidebar-next") (bind [ "pager" ] "\\Co" "sidebar-open") (bind [ "pager" ] "\\Cn" "sidebar-toggle-visible") (bind [ "pager" ] "m" "mail") (bind [ "pager" ] "r" "reply") (bind [ "pager" ] "R" "group-reply") (bind [ "pager" ] "f" "forward-message") (bind [ "pager" ] "c" "change-folder") (bind [ "pager" ] "s" "save-message") (bind [ "pager" ] "y" "copy-message") (bind [ "pager" ] "t" "tag-message") (bind [ "pager" ] "gh" "display-toggle-weed") (bind [ "pager" ] "dd" "delete-message") (bind [ "pager" ] "u" "undelete-message") # Attachment menu (bind [ "attach" ] "g" "noop") (bind [ "attach" ] "d" "noop") (bind [ "attach" ] ":" "noop") (bind [ "attach" ] "q" "noop") (bind [ "attach" ] "\\Ch" "help") (bind [ "attach" ] ":q" "exit") (bind [ "attach" ] ":w" "save-entry") (bind [ "attach" ] "j" "next-entry") (bind [ "attach" ] "k" "previous-entry") (bind [ "attach" ] "gg" "first-entry") (bind [ "attach" ] "G" "last-entry") (bind [ "attach" ] "\\Cd" "half-down") (bind [ "attach" ] "\\Cu" "half-up") (bind [ "attach" ] "l" "view-attach") (bind [ "attach" ] "s" "save-entry") (bind [ "attach" ] "p" "print-entry") (bind [ "attach" ] "dd" "delete-entry") (bind [ "attach" ] "u" "undelete-entry") # Mailbox browser (bind [ "browser" ] "g" "noop") (bind [ "browser" ] ":" "noop") (bind [ "browser" ] "q" "noop") (bind [ "browser" ] "\\Ch" "help") (bind [ "browser" ] ":q" "exit") (bind [ "browser" ] "j" "next-entry") (bind [ "browser" ] "k" "previous-entry") (bind [ "browser" ] "gg" "first-entry") (bind [ "browser" ] "G" "last-entry") (bind [ "browser" ] "l" "select-entry") (bind [ "browser" ] "\\Cd" "half-down") (bind [ "browser" ] "\\Cu" "half-up") # Compose menu (bind [ "compose" ] "g" "noop") (bind [ "compose" ] ":" "noop") (bind [ "compose" ] "q" "noop") (bind [ "compose" ] "\\Ch" "help") (bind [ "compose" ] ":q" "exit") (bind [ "compose" ] ":w" "postpone-message") (bind [ "compose" ] "j" "next-entry") (bind [ "compose" ] "k" "previous-entry") (bind [ "compose" ] "gg" "first-entry") (bind [ "compose" ] "G" "last-entry") (bind [ "compose" ] "\\Cd" "half-down") (bind [ "compose" ] "\\Cu" "half-up") (bind [ "compose" ] "y" "send-message") (bind [ "compose" ] "a" "attach-file") (bind [ "compose" ] "e" "edit-message") (bind [ "compose" ] "p" "postpone-message") ]; }