Add neomutt config

old-yadm
earnest ma 2021-07-24 10:17:52 -04:00
parent f0f1eda363
commit 6bd23a9fcf
No known key found for this signature in database
GPG Key ID: 6B361FA81C5FB695
5 changed files with 227 additions and 0 deletions

67
.config/neomutt/binds Normal file
View File

@ -0,0 +1,67 @@
# vim: filetype=muttrc
# ESC e to "recall" messages from draft folder
# General rebindings
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind pager c imap-fetch-mail
bind index G last-entry
bind index g noop
bind index gg first-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind browser h goto-parent
bind browser l select-entry
bind pager,browser gg top-page
bind pager,browser G bottom-page
bind index,pager,browser d half-down
bind index,pager,browser u half-up
bind index,pager R group-reply
bind index \031 previous-undeleted # Mouse wheel
bind index \005 next-undeleted # Mouse wheel
bind pager \031 previous-line # Mouse wheel
bind pager \005 next-line # Mouse wheel
bind editor <Tab> complete-query
# sidebar mappings
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible
# global index and pager shortcuts
bind index,pager @ compose-to-sender
bind index,pager D purge-message
bind index <tab> sync-mailbox
bind index <space> collapse-thread
# Email completion bindings
bind editor <Tab> complete-query
bind editor ^T complete
# Press A to add contact to Khard address book
macro index,pager A \
"<pipe-message>khard add-email<return>" \
"add the sender email address to khard"
## Shortcuts
macro index,pager <f1> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/main<enter><change-folder>!<enter>'
#macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/gmail<enter><change-folder>!<enter>'
#macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/main<enter><change-folder>!<enter>'
#macro index,pager <f4> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/school<enter><change-folder>!<enter>'

42
.config/neomutt/colors Normal file
View File

@ -0,0 +1,42 @@
###############################################################################
# Dracula Theme for Mutt: https://draculatheme.com/
#
# @author Paul Townsend <paul@caprica.org>
# general ------------ foreground ---- background -----------------------------
color error color231 color212
color indicator color231 color241
color markers color210 default
color message default default
color normal default default
color prompt default default
color search color84 default
color status color141 color236
color tilde color231 default
color tree color141 default
# message index ------ foreground ---- background -----------------------------
color index color210 default ~D # deleted messages
color index color84 default ~F # flagged messages
color index color117 default ~N # new messages
color index color212 default ~Q # messages which have been replied to
color index color215 default ~T # tagged messages
color index color141 default ~v # messages part of a collapsed thread
# message headers ---- foreground ---- background -----------------------------
color hdrdefault color117 default
color header color231 default ^Subject:.*
# message body ------- foreground ---- background -----------------------------
color attachment color228 default
color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses
color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs
color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text
color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text
color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text
color quoted color61 default
color quoted1 color117 default
color quoted2 color84 default
color quoted3 color215 default
color quoted4 color212 default
color signature color212 default

17
.config/neomutt/mailcap Normal file
View File

@ -0,0 +1,17 @@
# HTML
# Opens HTML in w3m in separate window but unsupported in pager
# text/html; w3m -I %{charset} -T text/html;
# Opens HTML as plaintext
# text/html; w3m -I %{charset} -T text/html; copiousoutput;
text/plain; nvim %s
text/html; firefox %s; test=test -n "$DISPLAY";
text/html; w3m -v -F -T text/html %s;
# PDF
application/pdf; /usr/bin/zathura %s pdf
#Images
image/png; /usr/bin/feh %s
image/jpeg; /usr/bin/feh %s

12
.config/neomutt/neomuttrc Normal file
View File

@ -0,0 +1,12 @@
# vim: filetype=muttrc
# https://gideonwolfe.com/posts/workflow/neomutt/intro/
# https://www.gideonwolfe.com/posts/sysadmin/nextcloud/nextcloudworkflow/
source ~/.config/neomutt/settings
source ~/.config/neomutt/colors
source ~/.config/neomutt/binds
# Accounts
source ~/.config/neomutt/accounts/main
folder-hook $folder 'source ~/.config/neomutt/accounts/main'

89
.config/neomutt/settings Normal file
View File

@ -0,0 +1,89 @@
# vim: filetype=muttrc
# General neomutt settings
# Editor
set editor = "nvim"
# Name (this needs to be changed either way)
set my_name = "earnest ma"
# Get all subscribed folders
set imap_check_subscribed
# Set preferred view modes
auto_view text/html text/calendar application/ics # view html automatically
alternative_order text/plain text/html text/enriched text/*
auto_view text/html # if there is only html dump that
# Main options
set envelope_from # Determine message's sender from "From:" header
set edit_headers # show headers when composing
set fast_reply # skip to compose when replying
set askcc # ask for CC:
set fcc_attach # save attachments with the body
set forward_format = "Fwd: %s" # format of subject when forwarding
set forward_decode # decode when forwarding
set attribution = "On %d, %n wrote:" # format of quoting header
set reply_to # reply to Reply to: field
set reverse_name # reply as whomever it was to
set include # include message in replies
set forward_quote # include message in forwards
set text_flowed # Use format=flowed
# set listchars=trail:• # Mark trailing spaces
# unset sig_dashes # no dashes before sig
unset mime_forward # forward attachments as part of body
# unset help # No help bar at the top of index
set status_on_top # Status bar on top of index
set tmpdir = ~/.cache/neomutt # where to keep temp files
unset confirmappend # don't ask, just do!
set quit # don't ask, just do!!
unset mark_old # read/new is good enough for me
set beep_new # bell on new mails
set pipe_decode # strip headers and eval mimes when piping
set thorough_search # strip headers and eval mimes before searching
set timeout = 300
# status bar, date format, finding stuff etc.
set status_chars = " *%A"
set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>─%?p?( %p postponed )?"
set date_format = "%d.%m.%Y %H:%M"
set sort = threads
set sort_aux = reverse-last-date-received
set uncollapse_jump
set sort_re
set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
set send_charset = "utf-8:iso-8859-1:us-ascii"
set charset = "utf-8"
set arrow_cursor = "no" # Change `color indicator` depending
# Auto-sync
timeout-hook 'exec sync-mailbox'
# When NeoMutt first loads, run this NeoMutt command
startup-hook 'exec sync-mailbox'
# When NeoMutt quits, run this NeoMutt command
shutdown-hook 'exec sync-mailbox'
# Sidebar
set mail_check_stats = yes
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
set sidebar_visible=yes
set sidebar_width=20
set sidebar_divider_char=' │ '
# set sidebar_short_path
# Pager View Options
set pager_index_lines = 10 # Shows 10 lines of index when pager is active
set pager_context = 3
set pager_stop
set menu_scroll
set tilde
unset markers
set mailcap_path = ~/.config/neomutt/mailcap
set header_cache = "~/.cache/neomutt"
set message_cachedir = "~/.cache/neomutt"
set query_command = "khard email --parsable --search-in-source-files '%s'"