Added neomutt

This commit is contained in:
dbroqua 2020-05-30 21:10:49 +02:00
parent 5d74e878dd
commit 694246f533
6 changed files with 364 additions and 0 deletions

2
.gitignore vendored
View file

@ -24,3 +24,5 @@ config/geary/account_*
local/share/geary
config/enchant
config/GIMP
config/neomutt/accounts
config/neomutt/signature

121
config/neomutt/colors Normal file
View file

@ -0,0 +1,121 @@
# vim: filetype=muttrc
# basic colors ---------------------------------------------------------
color normal color254 default
color error color160 default
color tilde color235 default
color message color37 default
color markers color160 default
color attachment color254 default
color search color61 default
color status color241 default
color indicator white color237
color tree color136 default # arrow in threads
# basic monocolor screen
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
# index ----------------------------------------------------------------
color index color160 default "~D(!~p|~p)" # deleted
color index color235 default ~F # flagged
color index color166 default ~= # duplicate messages
color index color140 default "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest
color index color160 default "~A" # all messages
color index color166 default "~E" # expired messages
color index color33 default "~N" # new messages
color index color33 default "~O" # old messages
color index color61 default "~Q" # messages that have been replied to
color index color252 default "~R" # read messages
color index color33 default "~U" # unread messages
color index color33 default "~U~$" # unread, unreferenced messages
color index color141 default "~v" # messages part of a collapsed thread
color index color141 default "~P" # messages from me
color index color37 default "~p!~F" # messages to me
color index color37 default "~N~p!~F" # new messages to me
color index color37 default "~U~p!~F" # unread messages to me
color index color252 default "~R~p!~F" # messages to me
color index color160 default "~F" # flagged messages
color index color160 default "~F~p" # flagged messages to me
color index color160 default "~N~F" # new flagged messages
color index color160 default "~N~F~p" # new flagged messages to me
color index color160 default "~U~F~p" # new flagged messages to me
color index color235 color160 "~D" # deleted messages
color index color245 default "~v~(!~N)" # collapsed thread with no unread
color index color136 default "~v~(~N)" # collapsed thread with some unread
color index color64 default "~N~v~(~N)" # collapsed thread with unread parent
# statusbg used to indicated flagged when foreground color shows other status
# for collapsed thread
color index color160 color235 "~v~(~F)!~N" # collapsed thread with flagged, no unread
color index color136 color235 "~v~(~F~N)" # collapsed thread with some unread & flagged
color index color64 color235 "~N~v~(~F~N)" # collapsed thread with unread parent & flagged
color index color64 color235 "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged
color index color37 color235 "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly
color index color136 color160 "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial)
color index color136 default "~T" # tagged messages
color index_author color32 default '.*'
color index_date color214 default
color index_size color28 default
# message headers ------------------------------------------------------
color header color251 default "^"
color hdrdefault color251 default
color header color214 default "^(Date)"
color header color251 default "^(From)"
color header color39 default "^(Subject)"
# body -----------------------------------------------------------------
color quoted color31 default
color quoted1 color37 default
color quoted2 color136 default
color quoted3 color160 default
color quoted4 color166 default
color signature color240 default
color bold color235 default
color underline color235 default
color normal color250 default
color body color245 default "[;:][-o][)/(|]" # emoticons
color body color245 default "[;:][)(|]" # emoticons
color body color245 default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\
|FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\
|IRL|RTFM|ROTFL|ROFL|YMMV)[*]?"
color body color245 default "[ ][*][^*]*[*][ ]?" # more emoticon?
color body color245 default "[ ]?[*][^*]*[*][ ]" # more emoticon?
## pgp
color body color160 default "(BAD signature)"
color body color37 default "(Good signature)"
color body color234 default "^gpg: Good signature .*"
color body color241 default "^gpg: "
color body color241 color160 "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
# yes, an insance URL regex
color body color33 default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
# Various smilies and the like
color body color230 default "<[Gg]>" # <g>
color body color230 default "<[Bb][Gg]>" # <bg>
color body color136 default " [;:]-*[})>{(<|]" # :-) etc...
# *bold*
color body color33 default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
# _underline_
color body color33 default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
# /italic/ (Sometimes gets directory names)
color body color33 default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
# Border lines.
color body color33 default "( *[-+=#*~_]){6,}"
# Sidebar
color sidebar_new color33 default
color sidebar_flagged color160 default
# set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
color progress white color237

11
config/neomutt/mailcap Normal file
View file

@ -0,0 +1,11 @@
text/html; firefox -new-tab %s & sleep 5; test=test -n "$DISPLAY";
#
# for mutt to view html e-mails
# text/html; w3m -I %{charset} -T text/html; copiousoutput
text/html; html2text %s; copiousoutput
application/pdf; evince %s; copiousoutput
# text/calendar; ~/.mutt/scripts/vcalendar-filter; copiousoutput
#text/calendar; mutt-ics; copiousoutput
#application/ics; mutt-ics; copiousoutput
application/*; xdg-open %s

40
config/neomutt/neomuttrc Normal file
View file

@ -0,0 +1,40 @@
source ~/.config/neomutt/settings
source ~/.config/neomutt/colors
source ~/.config/neomutt/sidebar
source ~/.config/neomutt/accounts/darkou
source ~/.config/neomutt/accounts/mousur
# Specify where to save and/or look for postponed messages.
##set postponed = +[Gmail]/Drafts
# Allow Mutt to open a new IMAP connection automatically.
#unset imap_passive
# Store message headers locally to speed things up.
# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things up even more.
#set header_cache = ~/.cache/mutt
# Store messages locally to speed things up, like searching message bodies.
# Can be the same folder as header_cache.
# This will cost important disk usage according to your e-mail amount.
#set message_cachedir = "~/.cache/mutt"
# Keep the IMAP connection alive by polling intermittently (time in seconds).
#set imap_keepalive = 300
# How often to check for new mail (time in seconds).
#set mail_check = 120
# Editor
#set editor = "vim"
#set charset = "utf-8"
#set record = '^'
# Mailbox ordering
#set sort_aux = reverse-last-date-received
#set sort = threads
# G to get mail
#bind index G imap-fetch-mail

144
config/neomutt/settings Normal file
View file

@ -0,0 +1,144 @@
# vim: filetype=muttrc
# Based on https://github.com/Nelyah/dotfiles
set editor=$EDITOR
set my_name = "Damien Broqua"
set realname = "Damien Broqua"
set imap_check_subscribed
# main options
set envelope_from
# Paths ----------------------------------------------
#set folder = ~/.mail # mailbox location
#set alias_file = ~/.config/neomutt/alias # where to store aliases
set header_cache = ~/.neomutt/cache/headers # where to store headers
set message_cachedir = ~/.neomutt/cache/bodies # where to store bodies
set certificate_file = ~/.neomutt/certificates # where to store certs
set mailcap_path = ~/.config/neomutt/mailcap # entries for filetypes
set tmpdir = ~/.neomutt/temp # where to keep temp files
# Basic Options --------------------------------------
set wait_key = no # shut up, mutt
set mbox_type = Maildir # mailbox type
set timeout = 3 # idle time before scanning
set mail_check = 120 # minimum time between scans
set mail_check_stats
unset move # gmail does that
set delete # don't ask, just do
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
# sort/threading
set sort = threads
set sort_aux = reverse-last-date-received
set sort_re
# look and feel
set pager_index_lines = 8
set pager_context = 5
set pager_stop
set menu_scroll
set smart_wrap
set tilde
unset markers
# composing
set fcc_attach
unset mime_forward
set forward_format = "Fwd: %s"
set include
set forward_quote
set smileys="(>From )|(:[-^]?[][)(><|/DPp])"
# Prevent on attachment
set abort_noattach='ask-yes'
set attach_keyword="\\<[Cc]i-joint\\>|\\<[Ff]ichier joint\\>|\\<[Pp]ièce jointe\\>"
# Headers infos
ignore * # first, ignore all headers
unignore from: to: cc: date: subject: # then, show only these
hdr_order from: to: cc: date: subject: # and in this order<Paste>
# Navigation
bind attach,index,pager \CD next-page
bind attach,index,pager \CB previous-page
bind index D purge-message
bind index,pager \Cb half-up
bind index,pager \Cd half-down
bind index,pager,attach g noop
bind index,pager,attach r group-reply
bind index,pager,attach \CR reply
#bind pager gg top
#bind pager G bottom
bind attach,index G last-entry
bind attach,index gg first-entry
bind attach,pager j next-line
bind attach,pager k previous-line
bind attach,pager J next-entry
bind attach,pager K previous-entry
bind editor <Tab> complete-query
#set query_command= "khard email --parsable --search-in-source-files '%s'"
#set query_command = "( khard email --parsable '%s' | sed -n '1!p'; mu cfind --format=mutt-ab '%s' )"
bind editor ^T complete
set edit_headers = yes
set sleep_time = 0
set autoedit
set edit_headers
# Allow Mutt to open a new IMAP connection automatically.
unset imap_passive
# Keep the IMAP connection alive by polling intermittently (time in seconds).
set imap_keepalive = 300
#auto_view text/html text/calendar application/ics # view html automatically
auto_view text/html
alternative_order text/enriched text/plain text/html text/*
#macro attach \CE "<pipe-message>khal import<enter>"
# Macros for switching accounts
macro index <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/darkou<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/accounts/mousur<enter><change-folder>!<enter>'
# use tab to switch between accounts, inspired by
# http://msmtp.sourceforge.net/doc/msmtp.html#Using-msmtp-with-Mutt
macro generic \Cx| "<enter-command>source"
macro generic \Cx& "<enter-command>macro index \\t \"\\Cx"
macro index <tab> "\Cx0" # default change to account 1, this will be redefined once pressed
macro generic \Cx0 "\Cx| ~/.mutt/accounts/darkou\"\n\Cx&1\"<enter><change-folder>!<enter>"
macro generic \Cx1 "\Cx| ~/.mutt/accounts/mousur\"\n\Cx&0\"<enter><change-folder>!<enter>"
set index_format="%3C %Z %[!%m.%d.%y] %-19.19n %?X?(%1X)& ? %?M?(%02M)& ? %s%> %?y?[%Y]?"
set index_format="%Z %3C %{%b %d} %-17.17n (%5c) %s"
set index_format="%3C %Z %{%b %d} %-19.19n (%5c) %?X?(%1X)& ? %?M?(%02M)& ? %s%> %?y?[%Y]?"
#macro index L "<enter-command>unset wait_key<enter><shell-escape>read -p 'mu query: ' x; echo \$x >~/.mu/search_term<enter><shell-escape>mu find --format=links --linksdir=~/.mail/search/ --clearlinks \$(cat ~/.mu/search_term)<enter><enter-command>set wait_key<enter>" "show only messages matching a notmuch pattern"
#macro index gf "<change-folder>~/.mail/search<enter>" "mu find results"
#macro index \cl "<enter-command>unset wait_key<enter><shell-escape>mu find --format=links --linksdir=~/testmail/ --clearlinks \$(cat ~/.mu/search_term)<enter><enter-command>set wait_key<enter>" "mu find results"
#macro index <F8> \
# "<enter-command>unset wait_key<enter><shell-escape>~/bin/mutt-notmuch --prompt search<enter><change-folder-readonly>~/.cache/mutt_results<enter>" \
# "search mail (using notmuch)"
#macro index <F9> \
# "<enter-command>unset wait_key<enter><pipe-message>~/bin/mutt-notmuch thread<enter><change-folder-readonly>~/.cache/mutt_results<enter><enter-command>set wait_key<enter>" \
# "search and reconstruct owning thread (using notmuch)"
#macro index,pager \cu "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
#macro attach,compose \cu "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"
# Sync all email
# If you want to make everything indexable after syncing email, use the office-alias
#macro index,pager P "<shell-escape>mbsync -a<enter>" "run mbsync to sync all mail"
macro index zc "<collapse-thread>" "collapse thread"
macro index zo "<collapse-thread>" "collapse thread"

46
config/neomutt/sidebar Normal file
View file

@ -0,0 +1,46 @@
# Example NeoMutt config file for the sidebar feature.
# --------------------------------------------------------------------------
# VARIABLES - shown with their default values
# --------------------------------------------------------------------------
# Should the Sidebar be shown?
set sidebar_sort_method = 'alpha'
set sidebar_visible = yes
set sidebar_folder_indent=yes # Indent folders whose names we've shortened
set sidebar_indent_string=' ' # Indent with two spaces
set sidebar_short_path # Shorten mailbox names
set mail_check_stats = yes
set sidebar_divider_char = ' │ '
#set sidebar_width = 25
set sidebar_short_path = yes
color sidebar_indicator default color25 # Dark blue background
color sidebar_highlight white color238 # Grey background
color sidebar_spoolfile yellow default # Yellow
color sidebar_flagged red default # Red
color sidebar_divider color8 default # Dark grey
color sidebar_new brightblue default
# When abbreviating mailbox path names, use any of these characters as path
# separators. Only the part after the last separators will be shown.
# For file folders '/' is good. For IMAP folders, often '.' is useful.
set sidebar_delim_chars='/.' # Delete everything up to the last / character
# --------------------------------------------------------------------------
# FUNCTIONS - shown with an example mapping
# --------------------------------------------------------------------------
# Move the highlight to the previous mailbox
bind index,pager \Cp sidebar-prev
# # Move the highlight to the next mailbox
bind index,pager \Cn sidebar-next
# # Open the highlighted mailbox
bind index,pager \Co sidebar-open
# Toggle the visibility of the Sidebar.
bind index,pager B sidebar-toggle-visible
# vim: syntax=muttrc