From 302f83b23b364b08dc47725266db5e20437d71e4 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 18 Jul 2026 00:30:32 +0530 Subject: feat(neomutt): add vim-style delete/copy keybindings, gf/gF swap, and private configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `dd`/`D` delete keybindings (single/thread) with vim-style `d` as prefix - Extend copy (`y`/`yy`) to work in both index and pager views - Add `gT` for previous-unread-mailbox (counterpart to `gt`) - Swap `gf`/`gF` so `gf` limits and `gF` clears filter (via macro) - Fix `binds` → `macros` in macros.nix and add `description` fields - Add `ZQ` (quit without saving) macro alongside existing `ZZ` - Add private email.nix and git.nix with personal account/identity config --- modules/communication/neomutt/keybindings.nix | 49 +++++++++++++++++++++------ 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'modules/communication/neomutt/keybindings.nix') diff --git a/modules/communication/neomutt/keybindings.nix b/modules/communication/neomutt/keybindings.nix index 8fde25e..6b9cdb4 100644 --- a/modules/communication/neomutt/keybindings.nix +++ b/modules/communication/neomutt/keybindings.nix @@ -69,7 +69,7 @@ action = "select-entry"; } - # --- back / exit (vim: h = left/back) --- + # --- back / exit / fold-close (vim: h = left/back) --- { map = [ "pager" ]; key = "h"; @@ -86,6 +86,10 @@ action = "exit"; } { + # in the index, h/l act as fold-close/fold-open on a thread + # rather than "back" (there's nowhere to go "back" to from the + # top-level index) -- same convention as fold/tree keybindings + # in tools like NERDTree or fugitive. map = [ "index" ]; key = "h"; action = "collapse-thread"; @@ -221,6 +225,24 @@ action = "search-opposite"; } + # --- delete / undelete (vim: dd delete line, u undo) --- + { + map = [ "index" ]; + key = "d"; + action = "noop"; + } + { + map = [ "index" ]; + key = "dd"; + action = "delete-message"; + } + { + # capital D deletes the whole thread, mirroring the v/V + # (single vs. whole-thread) convention used below for tagging + map = [ "index" ]; + key = "D"; + action = "delete-thread"; + } { map = [ "index" @@ -233,12 +255,18 @@ # --- copy (vim: yy yank -- non-destructive, unlike save-message # which moves/deletes the original) --- { - map = [ "index" ]; + map = [ + "index" + "pager" + ]; key = "y"; action = "noop"; } { - map = [ "index" ]; + map = [ + "index" + "pager" + ]; key = "yy"; action = "copy-message"; } @@ -259,24 +287,25 @@ action = "tag-thread"; } - # --- mailbox switching (vim: gt = next tab) --- + # --- mailbox switching (vim: gt/gT next/previous tab) --- { map = [ "index" ]; key = "gt"; action = "next-unread-mailbox"; } - - # --- filter/limit (vim: gf to 'find' or 'filter') --- { map = [ "index" ]; - key = "gf"; - action = "limit"; + key = "gT"; + action = "previous-unread-mailbox"; } - # --- filter/limit (vim: gf to 'find' or 'filter') --- + # --- filter/limit (vim: gf to 'find'/'filter') --- + # gF is the "clear filter" counterpart, defined as a macro + # (see macros.nix) since resetting the limit needs a fixed + # pattern rather than an interactive prompt. { map = [ "index" ]; - key = "gF"; + key = "gf"; action = "limit"; } -- cgit v1.2.3