2020-10-20 22:53:46 +02:00
# {{@@ header() @@}}
2020-11-02 18:58:06 +01:00
# _ _ _ _
# | \ | | ___ ___ _ __ ___ _ _| |_| |_
# | \| |/ _ \/ _ \| '_ ` _ \| | | | __| __|
# | |\ | __/ (_) | | | | | | |_| | |_| |_
# |_| \_|\___|\___/|_| |_| |_|\__,_|\__|\__|
2020-07-04 01:38:41 +02:00
2020-10-17 08:32:16 +02:00
set my_user='{{@@ username @@}}'
set my_host='{{@@ mail @@}}'
2020-10-21 02:06:29 +02:00
set my_pass=`_get-pass "$my_host"`
2020-07-04 01:38:41 +02:00
2020-11-03 01:59:23 +01:00
# Mailbox {{{
2020-07-04 01:38:41 +02:00
2020-10-21 02:06:29 +02:00
set realname = "$my_user"
set from = "${my_user}@${my_host}"
2020-07-04 01:38:41 +02:00
# Set MailDir
set mbox_type = Maildir
set folder = ~/.local/share/mail
set header_cache = ~/.cache/mutt/
# set Mailboxes
set spoolfile = "+INBOX"
2020-11-02 18:31:51 +01:00
set record = "+Sent"
2020-07-04 01:38:41 +02:00
set postponed = "+Drafts"
set trash = "+Trash"
2020-11-03 01:59:23 +01:00
2020-07-04 01:38:41 +02:00
mailboxes \
2020-12-04 03:53:41 +01:00
`echo ~/.local/share/mail/INBOX*` \
2020-07-04 01:38:41 +02:00
"=Sent" \
"=Drafts" \
"=Trash" \
2020-11-02 18:58:06 +01:00
2020-07-04 01:38:41 +02:00
set use_from = yes
2020-10-21 02:06:29 +02:00
set smtp_url = "smtps://${my_user}:${my_pass}@${my_host}"
2020-07-04 01:38:41 +02:00
set ssl_force_tls = yes
2020-11-03 01:59:23 +01:00
# }}}
# General {{{
2020-07-04 01:38:41 +02:00
set sort = 'reverse-date'
2020-11-03 01:59:23 +01:00
set mark_old = no # Unread mail stay unread until read
set mailcap_path = ~/.config/neomutt/mailcap
auto_view text/html # automatically show html
2020-07-04 01:38:41 +02:00
auto_view application/pgp-encrypted
alternative_order text/plain text/enriched text/html
set query_command= "khard email --parsable %s"
# }}}
# General rebindings{{{
# index
#
2020-08-04 17:10:38 +02:00
bind index "{{@@ key.left @@}}" noop
bind index "{{@@ key.down @@}}" next-entry
bind index "{{@@ key.up @@}}" previous-entry
bind index "{{@@ key.right @@}}" display-message
2020-07-04 01:38:41 +02:00
2020-10-27 18:52:11 +01:00
bind index <left> noop
bind index <down> next-entry
bind index <up> previous-entry
bind index <right> display-message
2020-11-03 01:59:23 +01:00
bind index g noop # needed to allow gg
2020-07-04 01:38:41 +02:00
bind index G last-entry
bind index gg first-entry
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index <space> tag-entry
2020-10-27 18:52:11 +01:00
2020-09-26 00:26:19 +02:00
# Attachment screen
bind attach <return> view-mailcap
bind attach "{{@@ key.up @@}}" previous-entry
bind attach "{{@@ key.down @@}}" next-entry
bind attach "{{@@ key.left @@}}" exit
bind attach "{{@@ key.right @@}}" view-mailcap
2020-07-04 01:38:41 +02:00
bind editor <space> noop
2020-09-24 19:44:17 +02:00
2020-09-26 00:26:19 +02:00
bind pager "{{@@ key.left @@}}" exit
bind pager "{{@@ key.down @@}}" next-line
bind pager "{{@@ key.up @@}}" previous-line
bind pager "{{@@ key.right @@}}" view-attachments
2020-09-24 19:44:17 +02:00
2020-10-27 18:52:11 +01:00
bind pager <left> exit
bind pager <down> next-line
bind pager <up> previous-line
bind pager <right> view-attachments
2020-11-03 01:59:23 +01:00
bind index,pager,browser '{{@@ key.up .upper() @@}}' half-up
bind index,pager,browser '{{@@ key.down.upper() @@}}' half-down
2020-10-27 18:52:11 +01:00
2020-09-24 19:44:17 +02:00
bind browser "{{@@ key.left @@}}" goto-parent
macro browser "{{@@ key.left @@}}" '<change-dir><kill-line>..<enter>' "Go to parent folder"
2020-07-04 01:38:41 +02:00
bind index,pager H view-raw-message
bind browser l select-entry
bind pager,browser gg top-page
bind pager,browser G bottom-page
bind index,pager S sync-mailbox
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
2020-11-08 17:39:00 +01:00
set abort_key="<ESC>"
2020-11-01 01:34:10 +01:00
macro index,pager a \
"<pipe-message>khard add-email<return>" \
"add the sender email address to khard"
# macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
2020-07-04 01:38:41 +02:00
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
macro index O "<shell-escape>mbsync -a<enter>" "run mbsync to sync all mail"
2020-11-23 22:30:17 +01:00
macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>read -p 'Enter a search term to find with notmuch: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"<enter>" "show only messages matching a notmuch pattern"
2020-07-04 01:38:41 +02:00
#macro index A "<limit>all\n" "show all messages (undo limit)"
# }}}
# Sidebar mappings{{{
set sidebar_visible = yes
set sidebar_width = 20
set sidebar_short_path = yes
set sidebar_next_new_wrap = yes
# set mail_check_stats
set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?'
2020-09-24 19:44:17 +02:00
bind index,pager "\C{{@@ key.down @@}}" sidebar-next
bind index,pager "\C{{@@ key.up @@}}" sidebar-prev
bind index,pager "\C{{@@ key.right @@}}" sidebar-open
2020-11-03 01:59:23 +01:00
bind index,pager "\C{{@@ key.left @@}}" sidebar-toggle-visible
2020-07-04 01:38:41 +02:00
# }}}
2020-11-03 01:59:23 +01:00
# Appearence{{{
2020-07-04 01:38:41 +02:00
2020-11-03 01:59:23 +01:00
set help = false # Don't show the menu bar at the top
2020-07-04 01:38:41 +02:00
2020-11-03 01:59:23 +01:00
set markers = no # Disables the `+` displayed at line wraps
set date_format="%m/%d %H:%M"
set index_format="%2C %zs %?X?A& ? %D %-15.15F %s"
2020-12-04 03:53:41 +01:00
set display_filter = 'sed -e "s/ */\n/g"'
2020-11-03 01:59:23 +01:00
#}}}
# colors{{{
2020-11-02 18:58:06 +01:00
2020-11-03 01:59:23 +01:00
# General
color status black default
color indicator brightwhite red
2020-11-02 18:58:06 +01:00
# Messages
2020-11-03 01:59:23 +01:00
color index default default '.*'
2020-11-02 18:58:06 +01:00
color index_number black default
color index_author red default '.*'
2020-11-03 01:59:23 +01:00
color index_subject green default '.*'
2020-11-02 18:58:06 +01:00
# New messages
color index brightgreen default "~N|~O"
color index_author brightred default "~N"
color index_subject brightcyan default "~N"
# Sidebar
color sidebar_new green default
color sidebar_highlight default green
color sidebar_indicator default red
color sidebar_divider black default
2020-07-04 01:38:41 +02:00
2020-11-03 01:59:23 +01:00
# Header - information for any open email
color header default default "^(Date)"
color header red default "^(From)"
color header green default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
# Content - Body of open email
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color attachment default black
# Comically large Regex{{{
color body red 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<>\"]"
# }}}
2020-07-04 01:38:41 +02:00
# }}}
2020-12-04 03:53:41 +01:00
# vim: ft=sh