From 53dc8c95e525f922461dfc1768121ee02380e4ec Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Wed, 5 Aug 2026 17:58:58 +0530 Subject: feat: Rewrote neomutt keybindings, updated comments - Rewriting the neomutt keybindings by hand - Updated comments to be simpler --- modules/communication/neomutt/macros.nix | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'modules/communication/neomutt/macros.nix') diff --git a/modules/communication/neomutt/macros.nix b/modules/communication/neomutt/macros.nix index 4a1fd5d..9ad3593 100644 --- a/modules/communication/neomutt/macros.nix +++ b/modules/communication/neomutt/macros.nix @@ -1,10 +1,9 @@ -# Macros - neomutt macros for sync, URL extraction, flag legend, and quit +# neomutt macros for sync, URL extraction, flag legend, and quit { config, lib, ... }: { config.programs.neomutt.macros = lib.mkIf config.communication.neomutt.enable [ { - # sync the mailbox and run the external sync script, silencing the - # "press any key" prompt around it. Vim mnemonic: g-prefixed, "go sync". + # Sync the mailbox and run the external sync script map = [ "index" "pager" @@ -13,9 +12,7 @@ action = "set my_wait_key=$wait_key wait_key=no${lib.getExe config.scripts.neomutt-sync.package}set wait_key=$my_wait_key"; } { - # extract every URL from the message via urlscan into a picker menu, - # then follow the selected one. Vim mnemonic: gx, same as vim-plugins - # that open the link/file under the cursor. + # Extract every URL from the message via urlscan into a picker menu map = [ "index" "pager" @@ -24,42 +21,31 @@ action = "urlscan"; } { - # open the message body in interactive chawan -- real vim-style - # cursor navigation (hjkl, Tab/Shift-Tab between links, Enter to - # follow, B back, q to return to neomutt). Replaces the old - # urlscan-based link picker. - # Kept on Ctrl-B since that's common muscle-memory for "open this in - # a browser-like view" - previous-page is intentionally NOT bound to - # Ctrl-B in the pager (see binds.nix) so this doesn't get shadowed. + # Open the message body in interactive chawan with vim-style navigation map = [ "pager" ]; key = "\\Cb"; action = "set my_pipe_decode=$pipe_decode pipe_decode=yes${lib.getExe config.web.chawan.package} -o \"title='neomutt'\"set pipe_decode=$my_pipe_decode"; } { - # on a specific attachment (not just the top-level - # message): pipe-entry sends the selected attachment instead. - # Same gx mnemonic as the index/pager macro above. + # Pipe the selected attachment instead of the whole message map = [ "attach" ]; key = "gx"; action = "${lib.getExe config.web.chawan.package} -o \"title='neomutt'\" "; } { - # clear the current limit/filter and show every message again, - # the counterpart to gf (interactive limit prompt) in binds.nix + # Clear the current limit and show every message again map = [ "index" ]; key = "gF"; action = "all"; } { - # save and quit, vim-style (sync mailbox, then quit) - same ZZ - # you'd type in vim to write and exit + # Save the mailbox and quit map = [ "index" ]; key = "ZZ"; action = ""; } { - # quit without saving, vim-style counterpart to ZZ - same ZQ - # you'd type in vim to discard and exit + # Quit without saving map = [ "index" ]; key = "ZQ"; action = ""; -- cgit v1.2.3