From 3e5c85e31ade2101a432be7ee4183c77417d156c Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Tue, 11 Aug 2026 00:12:24 +0530 Subject: feat: Using neovim for pager in neomutt, neomutt keybindings - Using neovim as a pager for neomutt to make it easier to read emails - Using universal :q for back/exit instead of q --- modules/communication/neomutt/neomutt.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules/communication/neomutt/neomutt.nix') diff --git a/modules/communication/neomutt/neomutt.nix b/modules/communication/neomutt/neomutt.nix index e25d0b3..7008433 100644 --- a/modules/communication/neomutt/neomutt.nix +++ b/modules/communication/neomutt/neomutt.nix @@ -38,7 +38,7 @@ nativeBuildInputs = [ pkgs.makeWrapper ]; postBuild = '' wrapProgram $out/bin/neomutt \ - --prefix PATH : ${lib.makeBinPath [ pkgs.urlscan ]} + --prefix PATH : ${config.home.profileDirectory}/bin:${lib.makeBinPath [ pkgs.urlscan ]} ''; meta.mainProgram = "neomutt"; }; @@ -47,7 +47,16 @@ vimKeys = false; unmailboxes = true; checkStatsInterval = 20; - extraConfig = builtins.readFile ./.neomuttrc; + extraConfig = '' + # Read messages in Neovim. `-` makes Neovim read the message from + # stdin and -R prevents accidental edits to message content. + set pager = "nvim -R -n +'setlocal nolist | silent! 1,2g/^$/delete _ | nohlsearch | setlocal nomodified nomodifiable' -" + # Return directly to the index when Neovim exits and do not prepend + # NeoMutt’s pager status line to the message passed to Neovim. + set noprompt_after + set pager_format = "" + '' + + builtins.readFile ./.neomuttrc; }; }; } -- cgit v1.2.3