From 8d282f06fa29fd6cf41fbce0de9aff680de92e9c Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Tue, 24 Nov 2020 02:35:29 -0600 Subject: [PATCH] Add files --- .gitignore | 1 + account.template | 24 ++++++++++++++++ colors | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ dependencies.txt | 5 ++++ keybinds | 57 +++++++++++++++++++++++++++++++++++++ mailcap | 9 ++++++ muttrc | 37 ++++++++++++++++++++++++ nixopen | 4 +++ 8 files changed, 211 insertions(+) create mode 100644 .gitignore create mode 100644 account.template create mode 100644 colors create mode 100644 dependencies.txt create mode 100644 keybinds create mode 100644 mailcap create mode 100644 muttrc create mode 100755 nixopen diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba7a6f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +account diff --git a/account.template b/account.template new file mode 100644 index 0000000..36d46c5 --- /dev/null +++ b/account.template @@ -0,0 +1,24 @@ +# vim: filetype=neomuttrc + +set imap_user = someone # IMAP username +set imap_pass = `pass someone@example.com` # get password from `pass` +set folder = "imaps://mail.example.com" # IMAP url +set spoolfile = +Inbox # Inbox +set record = +Sent # Sent (copy all sent messages to this mailbox) +set postponed = +Drafts # copy Drafts to here +set imap_check_subscribed # connect to all mailboxes + + +unset imap_passive # allow neomutt to automatically open a new IMAP connection +set imap_idle # connect with IMAP IDLE -- receive emails through push +set imap_keepalive = 300 # poll every x seconds to keep connection alive + + +set smtp_pass = $imap_pass # SMTP password same as IMAP password +set smtp_url = "smtps://$imap_user@mail.example.com" # SMTP url +set ssl_force_tls = yes # force the use of TLS +set ssl_starttls = yes # force STARTTLS + +set realname = "John Doe" # name shown on sent emails +set from = "someone@example.com" # from address +set use_from = yes # use the from address diff --git a/colors b/colors new file mode 100644 index 0000000..3424a11 --- /dev/null +++ b/colors @@ -0,0 +1,74 @@ +# vim: filetype=neomuttrc +# This is nearly 100% copied from https://github.com/LukeSmithxyz/mutt-wizard/blob/master/share/mutt-wizard.muttrc + +# Default index colors: +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.*' + +# New mail is boldened: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Tagged mail is highlighted: +color index brightyellow blue "~T" +color index_author brightred blue "~T" +color index_subject brightcyan blue "~T" + +# Other colors and aesthetic settings: +mono bold bold +mono underline underline +mono indicator reverse +mono error bold +color normal default default +color indicator brightblack white +color sidebar_highlight red default +color sidebar_divider brightblack black +color sidebar_flagged red black +color sidebar_new green black +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default +color normal default default + +# Regex highlighting: +color header blue default ".*" +color header brightmagenta default "^(From)" +color header brightcyan default "^(Subject)" +color header brightwhite default "^(CC|BCC)" +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 body green default "\`[^\`]*\`" # Green text between ` and ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +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<>\"]" diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000..883e47a --- /dev/null +++ b/dependencies.txt @@ -0,0 +1,5 @@ +neomutt +abook +lynx +pass +urlview diff --git a/keybinds b/keybinds new file mode 100644 index 0000000..bd0595a --- /dev/null +++ b/keybinds @@ -0,0 +1,57 @@ +# vim: filetype=neomuttrc +# Heavy copy from https://github.com/LukeSmithxyz/mutt-wizard + +bind index,pager i noop +bind index,pager g noop +bind index \Cf noop + +# General +bind index j next-entry +bind index k previous-entry +bind attach view-mailcap +bind attach l view-mailcap +bind editor noop +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 index M save-message +bind index,query tag-entry +macro browser h '..' "Go to parent folder" +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,browser d half-down +bind index,pager,browser u half-up +bind index,pager S sync-mailbox +bind index,pager R group-reply + +# Mouse wheel +bind index \031 previous-undeleted +bind index \005 next-undeleted +bind pager \031 previous-line +bind pager \005 next-line + +bind editor complete-query + +macro index,pager a "abook --add-email-quiet" "Add this sender to Abook" +macro index \Cr "T~UN." "Mark all messages as read" +macro index \Cu "T~UN." "Mark all messages as unread" +macro index A "all\n" "Show all messages (undo limit)" + +# Sidebar +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 # bind B to toggle sidebar diff --git a/mailcap b/mailcap new file mode 100644 index 0000000..2e3285e --- /dev/null +++ b/mailcap @@ -0,0 +1,9 @@ +text/plain; $EDITOR %s ; +text/html; ~/.config/mutt/nixopen %s ; nametemplate=%s.html +text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; +image/*; ~/.config/mutt/nixopen %s ; +video/*; ~/.config/mutt/nixopen %s ; +audio/*; ~/.config/mutt/nixopen %s ; +application/pdf; ~/.config/mutt/nixopen %s ; +application/pgp-encrypted; gpg -d '%s'; copiousoutput; +application/pgp-keys; gpg --import '%s'; copiousoutput; diff --git a/muttrc b/muttrc new file mode 100644 index 0000000..674402b --- /dev/null +++ b/muttrc @@ -0,0 +1,37 @@ +# vim: filetype=neomuttrc + +set header_cache = ~/.cache/mutt/header_cache # cache headers +set message_cachedir = ~/.cache/mutt # cache messages + +set sidebar_visible = yes # enable sidebar +set sidebar_width = 20 # sidebar width +set sidebar_short_path = yes +set sidebar_next_new_wrap = yes # ctrl-j/k will wrap around +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' # sidebar format +set mail_check_stats # count unread/read messages + +set query_command = "abook --mutt-query '%s'" # set up Abook + +set mailcap_path = ~/.config/mutt/mailcap +set mime_type_query_command = "file --mime-type -b %s" +set date_format = "%m/%d/%y %I:%M%p" +set index_format = "%4C %Z %D %-15.15F %s (%-4.4c)" +set rfc2047_parameters = yes +set sort = threads +set sort_aux = reverse-date +set markers = no # disable `+` displayed at line wraps +set mark_old = no # only mark messages as read if they have been opened +set mime_forward = yes # attachments are also forwarded +set fast_reply # skip directly to compose when replying +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # forward subject format +set forward_quote # include message in forward +set reverse_name # reply as whoever it was sent to +set include # include message in replies +auto_view text/html # automatically show html +auto_view application/pgp-encrypted +alternative_order text/plain text/enriched text/html + +source keybinds # load keybinds +source colors # load colors +source account # load account diff --git a/nixopen b/nixopen new file mode 100755 index 0000000..5635928 --- /dev/null +++ b/nixopen @@ -0,0 +1,4 @@ +#!/bin/sh + +[ "$(uname -s)" = "Darwin" ] && prog="open" || prog="xdg-open" +$prog "$@"