From 1a91cb7cdbcf6b18c27bbead57241baf279d4513 Mon Sep 17 00:00:00 2001 From: Gabriel Birke Date: Mon, 29 Apr 2024 23:54:54 +0200 Subject: [PATCH] neomutt: allow binds to override vimKeys In the generated neomutt configuration, source the optional `vim-keys.rc` before applying the `binds` configuration, to allow the user to override keybindings from `vim-keys.rc`. Adapt the test files to account for the empty space left by the unset `vimKeys` option. --- modules/programs/neomutt.nix | 6 +++--- tests/modules/programs/neomutt/neomutt-expected.conf | 4 ++-- .../programs/neomutt/neomutt-not-primary-expected.conf | 4 ++-- .../programs/neomutt/neomutt-with-binds-expected.conf | 4 ++-- .../programs/neomutt/neomutt-with-imap-expected.conf | 4 ++-- .../neomutt/neomutt-with-imap-type-mailboxes-expected.conf | 4 ++-- .../neomutt/neomutt-with-named-mailboxes-expected.conf | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 069c4de8..588b801e 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -457,15 +457,15 @@ in { set delete = yes + ${optionalString cfg.vimKeys + "source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"} + # Binds ${bindSection} # Macros ${macroSection} - ${optionalString cfg.vimKeys - "source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"} - # Register accounts ${ optionalString (accountCommandNeeded) '' diff --git a/tests/modules/programs/neomutt/neomutt-expected.conf b/tests/modules/programs/neomutt/neomutt-expected.conf index 94c13b29..2a45234d 100644 --- a/tests/modules/programs/neomutt/neomutt-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm@example.com mailboxes "/home/hm-user/Mail/hm@example.com/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf index cffdace6..47dc8173 100644 --- a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm-account mailboxes "/home/hm-user/Mail/hm-account/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf index 64ea6890..05736749 100644 --- a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf @@ -9,6 +9,8 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds bind editor "complete-query" bind index,pager \Cp "sidebar-prev" @@ -17,8 +19,6 @@ bind index,pager \Cp "sidebar-prev" macro index s "?" macro index,pager c "?^K=" - - # Register accounts # register account hm@example.com mailboxes "/home/hm-user/Mail/hm@example.com/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf index 005fd5b0..02f03f6e 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh' # register account hm@example.com diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf index c6838d4c..51c6c6b9 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh' # register account hm@example.com diff --git a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf index a166b355..605b5ed6 100644 --- a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm@example.com named-mailboxes "someCustomName" "/home/hm-user/Mail/hm@example.com/Inbox"