aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-12 01:43:39 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-12 01:43:39 +0530
commit6e228fcb5fcbd4520939627fbb8a127be98f6a8d (patch)
tree194c6b59d42866c18bdf3dc0cb4a159d480352d6
parent83e0d9883b10096a4cea5f51fea0590d4be19ebe (diff)
downloadhome-manager-config-6e228fcb5fcbd4520939627fbb8a127be98f6a8d.tar.gz
home-manager-config-6e228fcb5fcbd4520939627fbb8a127be98f6a8d.zip
feat(neomutt): added some more keybindings to neomutt config
-rw-r--r--modules/programs/neomutt/default.nix207
1 files changed, 195 insertions, 12 deletions
diff --git a/modules/programs/neomutt/default.nix b/modules/programs/neomutt/default.nix
index 818e921..30d3b11 100644
--- a/modules/programs/neomutt/default.nix
+++ b/modules/programs/neomutt/default.nix
@@ -93,6 +93,7 @@ in
'';
binds = [
+ # --- sidebar navigation (vim: k=up, j=down) ---
{
map = [
"index"
@@ -119,22 +120,38 @@ in
action = "sidebar-open";
}
+ # --- open / go deeper (vim: l = right/forward) ---
{
map = [ "index" ];
key = "<Return>";
action = "display-message";
}
{
+ map = [ "index" ];
+ key = "l";
+ action = "display-message";
+ }
+ {
map = [ "browser" ];
key = "<Return>";
action = "select-entry";
}
{
+ map = [ "browser" ];
+ key = "l";
+ action = "select-entry";
+ }
+ {
map = [ "attach" ];
key = "<Return>";
action = "view-attach";
}
{
+ map = [ "attach" ];
+ key = "l";
+ action = "view-attach";
+ }
+ {
map = [
"alias"
"query"
@@ -142,43 +159,203 @@ in
key = "<Return>";
action = "select-entry";
}
+
+ # --- back / exit (vim: h = left/back) ---
{
map = [ "pager" ];
- key = "<Return>";
- action = "next-page";
+ key = "h";
+ action = "exit";
}
-
{
- map = [ "index" ];
- key = "l";
- action = "display-message";
+ map = [ "browser" ];
+ key = "h";
+ action = "exit";
}
{
- map = [ "pager" ];
+ map = [ "attach" ];
key = "h";
action = "exit";
}
{
+ map = [ "index" ];
+ key = "h";
+ action = "collapse-thread";
+ }
+
+ # --- pager line scrolling (vim: j/k move by line) ---
+ {
+ map = [ "pager" ];
+ key = "j";
+ action = "next-line";
+ }
+ {
+ map = [ "pager" ];
+ key = "k";
+ action = "previous-line";
+ }
+ {
+ # kept from before: jump straight to the next unread message,
+ # extends the h/l "back/forward" metaphor already in use
map = [ "pager" ];
key = "l";
action = "next-unread";
}
+
+ # --- top/bottom of buffer (vim: gg/G -- NOT 0/$, which mean
+ # start/end of *line* in vim and would be a false friend here) ---
{
map = [ "index" ];
- key = "h";
- action = "collapse-thread";
+ key = "gg";
+ action = "first-entry";
+ }
+ {
+ map = [ "index" ];
+ key = "G";
+ action = "last-entry";
}
-
{
map = [ "pager" ];
- key = "0";
+ key = "gg";
action = "top";
}
{
map = [ "pager" ];
- key = "$";
+ key = "G";
action = "bottom";
}
+ {
+ map = [ "browser" ];
+ key = "gg";
+ action = "first-entry";
+ }
+ {
+ map = [ "browser" ];
+ key = "G";
+ action = "last-entry";
+ }
+
+ # --- page scrolling (vim: Ctrl-f/b full page, Ctrl-d/u half page) ---
+ {
+ map = [ "pager" ];
+ key = "\\Cf";
+ action = "next-page";
+ }
+ {
+ map = [ "pager" ];
+ key = "\\Cb";
+ action = "previous-page";
+ }
+ {
+ map = [ "pager" ];
+ key = "\\Cd";
+ action = "half-down";
+ }
+ {
+ map = [ "pager" ];
+ key = "\\Cu";
+ action = "half-up";
+ }
+ {
+ # index has no half-page concept, so Ctrl-d/u fall back to
+ # the same full-page scroll as Ctrl-f/b
+ map = [ "index" ];
+ key = "\\Cf";
+ action = "next-page";
+ }
+ {
+ map = [ "index" ];
+ key = "\\Cb";
+ action = "previous-page";
+ }
+ {
+ map = [ "index" ];
+ key = "\\Cd";
+ action = "next-page";
+ }
+ {
+ map = [ "index" ];
+ key = "\\Cu";
+ action = "previous-page";
+ }
+
+ # --- search (vim: / forward, ? backward, n/N repeat) ---
+ {
+ map = [
+ "index"
+ "pager"
+ ];
+ key = "/";
+ action = "search";
+ }
+ {
+ map = [
+ "index"
+ "pager"
+ ];
+ key = "?";
+ action = "search-reverse";
+ }
+ {
+ map = [
+ "index"
+ "pager"
+ ];
+ key = "n";
+ action = "search-next";
+ }
+ {
+ map = [
+ "index"
+ "pager"
+ ];
+ key = "N";
+ action = "search-opposite";
+ }
+
+ {
+ map = [
+ "index"
+ "pager"
+ ];
+ key = "u";
+ action = "undelete-message";
+ }
+
+ # --- copy (vim: yy yank -- non-destructive, unlike save-message
+ # which moves/deletes the original) ---
+ {
+ map = [ "index" ];
+ key = "y";
+ action = "noop";
+ }
+ {
+ map = [ "index" ];
+ key = "yy";
+ action = "copy-message";
+ }
+
+ # --- tagging (vim: v/V visual select single/whole block) ---
+ # NOTE: this overrides neomutt's default "v" (view-attachments).
+ # Attachments are still reachable from the pager/index via the
+ # mailcap auto-view or the attach menu, but if you want plain
+ # "v" back for view-attachments, just delete these two binds.
+ {
+ map = [ "index" ];
+ key = "v";
+ action = "tag-entry";
+ }
+ {
+ map = [ "index" ];
+ key = "V";
+ action = "tag-thread";
+ }
+
+ # --- mailbox switching (vim: gt = next tab) ---
+ {
+ map = [ "index" ];
+ key = "gt";
+ action = "next-unread-mailbox";
+ }
];
macros = [
@@ -207,6 +384,12 @@ in
key = "gl";
action = "<shell-escape>less ~/.config/neomutt/flag_legend.txt<enter>";
}
+ {
+ # ZZ: save and quit, vim-style (sync mailbox, then quit)
+ map = [ "index" ];
+ key = "ZZ";
+ action = "<sync-mailbox><quit>";
+ }
];
};
};