This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/dotfiles/neomutt/neomuttrc

196 lines
7.0 KiB
Plaintext
Raw Normal View History

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-11-03 01:59:23 +01:00
# Mailbox {{{
2020-07-04 01:38:41 +02:00
# Set MailDir
set mbox_type = Maildir
set header_cache = ~/.cache/mutt/
2021-03-02 06:01:31 +01:00
set my_mailroot = ~/.local/share/mail
set use_from = yes
2022-02-04 03:09:49 +01:00
# set ssl_force_tls = yes
2020-07-04 01:38:41 +02:00
2021-03-02 06:01:31 +01:00
{%@@ for name, info in mail.items() | reverse @@%}
2022-02-04 03:09:49 +01:00
set my_source_command = "_mutt_get-mail '{{@@ name @@}}' |"
folder-hook "$my_mailroot/{{@@ name @@}}/" source "\"$my_source_command\""
source "$my_source_command"
2021-03-02 06:01:31 +01:00
{%@@ endfor @@%}
2020-07-04 01:38:41 +02:00
2021-03-02 06:01:31 +01:00
{%@@ for name, info in mail.items() @@%}
2022-02-04 03:09:49 +01:00
set my_source_command = "_mutt_get-mail '{{@@ name @@}}' |"
macro index,pager <f{{@@ loop.index @@}}> "<sync-mailbox><enter-command>source \"$my_source_command\"<enter><change-folder>!<enter>"
2021-03-02 06:01:31 +01:00
{%@@ endfor @@%}
2020-11-02 18:58:06 +01:00
2020-11-03 01:59:23 +01:00
# }}}
# General {{{
2021-10-23 04:51:04 +02:00
set use_threads = threads
set sort = reverse-last-date
set sort_aux = last-date
set mail_check_stats = yes
2022-02-04 03:09:49 +01:00
set mail_check_stats_interval = 10
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
2021-03-05 02:34:08 +01:00
# Mouse wheel
bind index \031 previous-undeleted
bind index \005 next-undeleted
bind pager \031 previous-line
bind pager \005 next-line
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
2021-03-05 02:34:08 +01:00
# Don't show the menu bar at the top
set help = false
2020-07-04 01:38:41 +02:00
2021-03-05 02:34:08 +01:00
# Disables the `+` displayed at line wraps
set markers = no
2020-11-03 01:59:23 +01:00
set date_format="%m/%d %H:%M"
2021-10-23 04:51:04 +02:00
set index_format="%3C %zs %?X?A& ? %D %-15.15F %s"
2020-11-03 01:59:23 +01:00
set display_filter = '_mutt_escape-html-chars'
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
2021-02-22 03:20:24 +01:00
color indicator brightwhite {{@@ accent_color_name @@}}
2020-11-02 18:58:06 +01:00
# Messages
2021-03-05 02:34:08 +01:00
color index default default '.*'
color index_number black default
color index_author {{@@ accent_color_name @@}} default '.*'
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
2021-03-05 02:34:08 +01:00
color sidebar_new green default
color sidebar_highlight default green
2021-02-22 03:20:24 +01:00
color sidebar_indicator brightwhite {{@@ accent_color_name @@}}
2021-03-05 02:34:08 +01:00
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
2021-03-05 02:34:08 +01:00
color header default default "^(Date)"
color header {{@@ accent_color_name @@}} default "^(From)"
color header green default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
2020-11-03 01:59:23 +01:00
# 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