From b2bb3c637acc6ade6387421c6b26be72d92cb93d Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 20 Nov 2022 16:31:26 +0100 Subject: Add neomutt config --- .gitmodules | 3 ++ catppuccin/neomutt | 1 + home-configuration.scm | 5 ++ muttrc | 139 +++++++++++++++++++++++++++++++++++++++++++++++++ vim-keys.muttrc | 36 +++++++++++++ 5 files changed, 184 insertions(+) create mode 160000 catppuccin/neomutt create mode 100644 muttrc create mode 100644 vim-keys.muttrc diff --git a/.gitmodules b/.gitmodules index f413265f..e9134c8c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "catppuccin/zathura"] path = catppuccin/zathura url = https://github.com/catppuccin/zathura +[submodule "catppuccin/neomutt"] + path = catppuccin/neomutt + url = https://github.com/catppuccin/neomutt diff --git a/catppuccin/neomutt b/catppuccin/neomutt new file mode 160000 index 00000000..f6ce83da --- /dev/null +++ b/catppuccin/neomutt @@ -0,0 +1 @@ +Subproject commit f6ce83da47cc36d5639b0d54e7f5f63cdaf69f11 diff --git a/home-configuration.scm b/home-configuration.scm index 7d34386e..4c88248b 100644 --- a/home-configuration.scm +++ b/home-configuration.scm @@ -380,6 +380,11 @@ replacement spec (to which `regexp-substitute/global' is applied)." ,(plain-file "alibuild-disable-analytics" "")) ("git/config" ,(local-file "gitconfig")) ("htop/htoprc" ,(local-file "htoprc")) + ("mutt/muttrc" ,(local-file "muttrc")) + ("mutt/catppuccin.muttrc" + ,(local-file #.(if (string=? catppuccin-theme-variant "latte") + "catppuccin/neomutt/latte-neomuttrc" + "catppuccin/neomutt/neomuttrc"))) ("lesskey" ,(local-file "lesskey")) ("ranger/rc.conf" ,(local-file "ranger.conf")))) diff --git a/muttrc b/muttrc new file mode 100644 index 00000000..7a57090a --- /dev/null +++ b/muttrc @@ -0,0 +1,139 @@ +# -*- mode: conf-space; -*- +# Colour scheme +source `echo "\$XDG_CONFIG_HOME/mutt/catppuccin.muttrc"` +color index color2 default ~O # unread, but not new, messages are green, like new messages + +# Vim-like keybindings +source ~/.guix-home/profile/share/doc/neomutt/vim-keys/vim-keys.rc +# I have a Return key, not an Enter key, and I want to use it to display the +# message, not reply to it. +bind index '' display-message +bind index '' list-reply +# group-chat-reply = reply to all recipients preserving To/Cc. +bind index a group-chat-reply +bind pager a group-chat-reply + +set abort_nosubject = ask-yes +set abort_unmodified = ask-yes +set auto_edit edit_headers fast_reply reverse_name noreverse_real_name +set sig_dashes sig_on_top +set pager_stop pager_index_lines=10 pager_context=2 pager_skip_quoted_context=3 + +set sort = "reverse-date" # newest first, threads grouped +set use_threads = "threads" +unset mark_old # always keep unread messages as "new" +set tilde nomarkers +set sleep_time = 0 # no delay when switching mailboxes to display info +set auto_tag # commands automatically apply to tagged messages (if any), without having to press ";" +set delete # auto-purge deleted messages when syncing + +# show IMAP mailboxes in the sidebar +set imap_check_subscribed + +set sidebar_visible sidebar_format = "%B%* %?F? %F!?%?N? %N?" +set sidebar_folder_indent sidebar_short_path + +set index_format = "%4C %Z %[%_d %b %H:%M] %-15.15L %s%* %?l?%4l&%4c?" +set status_format = " %r %f (%?M?%M/?%m#%?n? %nN?%?o? %oO?%?d? %dD?%?F? %FF?%?t? %t*?%?p? %pP?%?b? %bE?%?l? %l?) %> %s/%S %P " +set sidebar_format = "%D%* %!%?N? %N?" +set attach_format = "%u%D%I %t%4n %T%.40d%> %.9m/%.12M, %.6e%?C?, %C?, %4s " + +set mail_check_stats +set pgp_decrypt_command = "gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" +set smime_encrypt_self smime_default_key = 681F69B0 +unset arrow_cursor +set ssl_force_tls + +set new_mail_command = "if [ %u -gt 0 ]; then dunstify -a neomutt -i mail-unread 'New mail' 'You have %u unread messages.'; fi" + +set history = 1000 +set history_file = `echo "\$XDG_DATA_HOME/share/mutthistory"` +set save_history = 1000 + +# For using both, header and body caching, $header_cache and +# $message_cachedir can be safely set to the same value. +set message_cachedir = `echo "\$XDG_CACHE_HOME/neomutt/"` +set header_cache = `echo "\$XDG_CACHE_HOME/neomutt/"` + +alternative_order text/plain text/enriched text/html text image +auto_view text/html image/jpeg image/png + +# needed for catimg +set allow_ansi = yes + +set my_mythic = "imaps://oncilla.mythic-beasts.com/" +account-hook "$my_mythic" 'set folder = "$my_mythic"' +account-hook "$my_mythic" 'set smtp_url = "smtps://smtp-auth.mythic-beasts.com"' +account-hook "$my_mythic" 'set imap_user = "timo@twilken.net"' +account-hook "$my_mythic" 'set smtp_user = "timo@twilken.net"' +account-hook "$my_mythic" 'set imap_pass = `pass www/mythic-beasts/email/timo | head -1`' +account-hook "$my_mythic" 'set smtp_pass = `pass www/mythic-beasts/email/timo | head -1`' +account-hook "$my_mythic" 'set spool_file = +INBOX' +account-hook "$my_mythic" 'set postponed = +Drafts' +account-hook "$my_mythic" 'set record = +Sent' +account-hook "$my_mythic" 'reset ssl_use_tlsv1' +account-hook "$my_mythic" 'reset ssl_use_tlsv1_1' + +set my_cern = "imaps://imap.cern.ch/" +account-hook "$my_cern" 'set folder = "$my_cern"' +account-hook "$my_cern" 'set smtp_url = "smtps://smtp.cern.ch"' +account-hook "$my_cern" 'set imap_user = "twilken"' +account-hook "$my_cern" 'set smtp_user = "twilken"' +account-hook "$my_cern" 'set imap_pass = `pass cern/sso | head -1`' +account-hook "$my_cern" 'set smtp_pass = `pass cern/sso | head -1`' +account-hook "$my_cern" 'set spool_file = +INBOX' +account-hook "$my_cern" 'set postponed = +Drafts' +account-hook "$my_cern" 'set record = +Sent' +account-hook "$my_cern" 'set ssl_use_tlsv1 = yes' # imap.cern.ch needs this; ... +account-hook "$my_cern" 'set ssl_use_tlsv1_1 = yes' # ...make sure to reset for other accounts! + +set my_gmail = "imaps://imap.gmail.com/" +account-hook "$my_gmail" 'set folder = "$my_gmail"' +account-hook "$my_gmail" 'set smtp_url = "smtps://smtp.gmail.com"' +account-hook "$my_gmail" 'set imap_user = "timo.21.wilken@gmail.com"' +account-hook "$my_gmail" 'set smtp_user = "timo.21.wilken@gmail.com"' +account-hook "$my_gmail" 'set imap_pass = `pass www/google/app-passwords/mutt | head -1`' +account-hook "$my_gmail" 'set smtp_pass = `pass www/google/app-passwords/mutt | head -1`' +account-hook "$my_gmail" 'set spool_file = +INBOX' +account-hook "$my_gmail" 'set postponed = "+[Gmail]/Drafts"' +account-hook "$my_gmail" 'set record = "+[Gmail]/Sent Mail"' +account-hook "$my_gmail" 'reset ssl_use_tlsv1' +account-hook "$my_gmail" 'reset ssl_use_tlsv1_1' + +# ExOl needs OAUTH now! +# https://neomutt.org/guide/optionalfeatures.html#oauth +set my_cantab = "imaps://tw466@cantab.ac.uk@outlook.office365.com/" +account-hook "$my_cantab" 'set folder = "$my_cantab"' +account-hook "$my_cantab" 'set smtp_url = "smtps://smtp-mail.outlook.com"' +account-hook "$my_cantab" 'set imap_user = "tw466@cantab.ac.uk"' +account-hook "$my_cantab" 'set smtp_user = "tw466@cantab.ac.uk"' +account-hook "$my_cantab" 'set imap_pass = `pass cambridge/raven | head -1`' +account-hook "$my_cantab" 'set smtp_pass = `pass cambridge/raven | head -1`' +account-hook "$my_cantab" 'set spool_file = +INBOX' +account-hook "$my_cantab" 'set postponed = +Drafts' +account-hook "$my_cantab" 'set record = +Sent' +account-hook "$my_cantab" 'reset ssl_use_tlsv1' +account-hook "$my_cantab" 'reset ssl_use_tlsv1_1' + +set my_outlook = "imaps://timo_wilken@live.co.uk@outlook.office365.com/" +account-hook "$my_outlook" 'set folder = "$my_outlook"' +account-hook "$my_outlook" 'set smtp_url = "smtps://smtp-mail.outlook.com"' +account-hook "$my_outlook" 'set imap_user = "timo_wilken@live.co.uk"' +account-hook "$my_outlook" 'set smtp_user = "timo_wilken@live.co.uk"' +account-hook "$my_outlook" 'set imap_pass = `pass www/microsoft | head -1`' +account-hook "$my_outlook" 'set smtp_pass = `pass www/microsoft | head -1`' +account-hook "$my_outlook" 'set spool_file = +INBOX' +account-hook "$my_outlook" 'set postponed = +Drafts' +account-hook "$my_outlook" 'set record = +Sent' +account-hook "$my_outlook" 'reset ssl_use_tlsv1' +account-hook "$my_outlook" 'reset ssl_use_tlsv1_1' + +macro index,pager gm "set folder=$my_mythic+INBOX" "Switch to Mythic Beasts account" +macro index,pager gG "set folder=$my_gmail+INBOX" "Switch to Gmail account" +macro index,pager gw "set folder=$my_cern+INBOX" "Switch to CERN account" +macro index,pager gc "set folder=$my_cantab+INBOX" "Switch to Cantab account" +macro index,pager go "set folder=$my_outlook+INBOX" "Switch to Outlook account" + +# Open the Mythic inbox by default. +set folder = "$my_mythic" +set spool_file = "+INBOX" diff --git a/vim-keys.muttrc b/vim-keys.muttrc new file mode 100644 index 00000000..a995a931 --- /dev/null +++ b/vim-keys.muttrc @@ -0,0 +1,36 @@ +# Moving around +bind attach,browser,index g noop +bind attach,browser,index gg first-entry +bind attach,browser,index G last-entry +bind pager g noop +bind pager gg top +bind pager G bottom +#bind pager k previous-line +#bind pager j next-line + +# Scrolling +bind attach,browser,pager,index \CF next-page +bind attach,browser,pager,index \CB previous-page +bind attach,browser,pager,index \Cu half-up +bind attach,browser,pager,index \Cd half-down +bind browser,pager \Ce next-line +bind browser,pager \Cy previous-line +bind index \Ce next-line +bind index \Cy previous-line + +bind pager,index d noop +bind pager,index dd delete-message + +# Mail & Reply +bind index \Cl list-reply + +# Threads +bind browser,pager,index N search-opposite +bind pager,index dT delete-thread +bind pager,index dt delete-subthread +bind pager,index gt next-thread +bind pager,index gT previous-thread +bind index za collapse-thread +bind index zA collapse-all # Missing :folddisable/foldenable + +# vim:ft=muttrc: -- cgit v1.2.3