From a689fa37dd01d87a98e9c79f1581b27fd14d598e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 28 Jan 2017 15:31:57 +1300 Subject: More generic Mutt configuration Remove some person and system specific stuff, including my signature; nothing complex about that, after all. --- .gitignore | 1 - Makefile | 34 ++-------- mail/mailrc.m4 | 3 - mutt/muttrc | 134 ++++++++++++++++++++++++++++++++++++ mutt/muttrc.d/src | 6 ++ mutt/muttrc.m4 | 153 ------------------------------------------ mutt/signature | 2 - vim/after/ftdetect/muttrc.vim | 12 ++++ 8 files changed, 156 insertions(+), 189 deletions(-) delete mode 100644 mail/mailrc.m4 create mode 100644 mutt/muttrc create mode 100755 mutt/muttrc.d/src delete mode 100644 mutt/muttrc.m4 delete mode 100644 mutt/signature create mode 100644 vim/after/ftdetect/muttrc.vim diff --git a/.gitignore b/.gitignore index 6e82dcd6..22e40356 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,5 @@ git/gitconfig gnupg/gpg.conf mail/mailrc man/man7/dotfiles.7df -mutt/muttrc tmux/tmux.conf urxvt/ext/select diff --git a/Makefile b/Makefile index e35d5c40..ae1655fa 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,6 @@ install-gtk \ install-i3 \ install-less \ - install-mail \ - install-maildir \ install-mutt \ install-ncmcpp \ install-newsbeuter \ @@ -113,9 +111,7 @@ clean distclean : $(GAMES) \ git/gitconfig \ gnupg/gpg.conf \ - mail/mailrc \ - man/man7/dotfiles.7df \ - mutt/muttrc \ + man/man8/dotfiles.7df \ tmux/tmux.conf \ urxvt/ext/select @@ -135,22 +131,12 @@ gnupg/gpg.conf : gnupg/gpg.conf.m4 -D DOTFILES_KEYSERVER="$(KEYSERVER)" \ gnupg/gpg.conf.m4 > gnupg/gpg.conf -mail/mailrc : mail/mailrc.m4 - m4 -D DOTFILES_SENDMAIL="$$(command -v "$(SENDMAIL)")" \ - mail/mailrc.m4 > "$@" - man/man7/dotfiles.7df : README.markdown man/man7/dotfiles.7df.header cat man/man7/dotfiles.7df.header README.markdown | \ pandoc -sS -t man -o "$@" MAILDIR := $(HOME)/Mail -mutt/muttrc : mutt/muttrc.m4 - m4 \ - -D DOTFILES_SENDMAIL="$(SENDMAIL)" \ - -D DOTFILES_MAILDIR="$(MAILDIR)" \ - mutt/muttrc.m4 > mutt/muttrc - TMUX_BG := colour237 TMUX_FG := colour248 @@ -270,24 +256,12 @@ install-less : install -pm 0644 -- less/lesskey "$(HOME)"/.lesskey command -v lesskey && lesskey -install-mail : mail/mailrc - install -pm 0644 -- mail/mailrc "$(HOME)"/.mailrc - -install-maildir : - for box in drafts inbox sent ; do \ - for dir in cur new tmp ; do \ - install -m 0755 -d -- \ - "$(MAILDIR)"/"$$box"/"$$dir" ; \ - done ; \ - done - -install-mutt : mutt/muttrc install-mail install-maildir +install-mutt : install -m 0755 -d -- \ - "$(HOME)"/.mutt \ + "$(HOME)"/.muttrc.d \ "$(HOME)"/.cache/mutt install -pm 0644 -- mutt/muttrc "$(HOME)"/.muttrc - install -pm 0644 -- mutt/signature "$(HOME)"/.signature - [ -f "$(HOME)"/.mutt/muttrc.local ] || touch "$(HOME)"/.mutt/muttrc.local + install -pm 0755 -- mutt/muttrc.d/src "$(HOME)"/.muttrc.d install-ncmcpp : install -m 0755 -d -- "$(HOME)"/.ncmpcpp diff --git a/mail/mailrc.m4 b/mail/mailrc.m4 deleted file mode 100644 index 873fe080..00000000 --- a/mail/mailrc.m4 +++ /dev/null @@ -1,3 +0,0 @@ -set sendmail=DOTFILES_SENDMAIL -unset askcc -set nosave skipempty diff --git a/mutt/muttrc b/mutt/muttrc new file mode 100644 index 00000000..7f40e617 --- /dev/null +++ b/mutt/muttrc @@ -0,0 +1,134 @@ +# Addresses +set query_command = 'abook --mutt-query %s' +set reverse_name = yes +set use_domain = yes +set use_from = yes + +# Alerts +set beep_new = yes + +# Attachments +attachments +A */.* +attachments -A text/x-vcard application/pgp.* +attachments -A application/x-pkcs7-.* +attachments +I text/plain +attachments -A message/external-body +attachments -I message/external-body + +# Caching +set header_cache = '~/.cache/mutt/headers' + +# Colors +color attachment brightyellow default +color hdrdefault cyan default +color indicator black white +color markers brightred default +color normal default default +color quoted green default +color signature cyan default +color status default color22 +color tilde brightblack default +color tree default default + +# Completion +bind editor complete-query +bind editor ^T complete + +# Files +set delete = yes +set move = no + +# Flags +set mark_old = no + +# Headers +ignore * +unignore Date From: To Cc Subject +hdr_order Date From: To Cc Subject +set edit_headers = yes + +# Index +set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %s' + +# Interaction +set abort_unmodified = no +set confirmappend = no +set wait_key = no +set quit = ask-yes + +# Intervals +set mail_check = 5 +set sleep_time = 0 + +# Mailboxes +set confirmcreate = yes + +# Menus +set menu_context = 1 + +# MIME +mime_lookup application/octet-stream + +# Pager +set pager_context = 1 +set pager_format = '%4C %Z %[!%b %e at %I:%M %p] %.20n %s%* -- (%P)' +set pager_stop = yes + +# Presentation/formatting +set markers = no +set smart_wrap = yes +set text_flowed = yes +set tilde = yes +alternative_order text/plain text/html * +auto_view text/html + +# Quoting +set quote_regexp = '^(>[ \t]*)+' + +# Responses +set fast_reply = yes +set forward_format = 'Fw: %s' +set include = yes +set use_envelope_from = yes + +# Searching/sorting +set sort = 'threads' +set sort_aux = 'last-date-received' +set strict_threads = yes +set thorough_search = yes + +# SSH +set time_inc = 250 + +# Encryption settings +set crypt_replysign = yes +set crypt_replyencrypt = yes +set crypt_replysignencrypted = yes +set crypt_use_gpgme = yes +set crypt_use_pka = yes +set crypt_verify_sig = yes + +# Vim-ish bindings +bind index gg first-entry +bind index G last-entry +bind pager gg top +bind pager G bottom +bind index,pager \Cu half-up +bind index,pager \Cd half-down +bind generic,index,browser,pager \Cf next-page +bind generic,index,browser,pager \Cb previous-page + +# Turn off annoying mailbox lock feature +bind index '%' noop + +# Blindly save message to whatever box is suggested +macro index,pager S 's' 'Save message blindly' + +# Run gms to retrieve all mail +macro generic,index,browser,pager gm '!gms --quiet &' 'Run gms(1df)' + +# Shortcut to add addresses to abook +macro index,pager A 'abook --add-email' 'Add sender address to abook' + +# Machine or account specific settings +source ~/.muttrc.d/src| diff --git a/mutt/muttrc.d/src b/mutt/muttrc.d/src new file mode 100755 index 00000000..584a2785 --- /dev/null +++ b/mutt/muttrc.d/src @@ -0,0 +1,6 @@ +#!/bin/sh +# Helper script to emit the source all muttrc subfiles, in LC_COLLATE order +for rc in "$HOME"/.muttrc.d/*.rc ; do + [ -e "$rc" ] || continue + cat -- "$rc" +done diff --git a/mutt/muttrc.m4 b/mutt/muttrc.m4 deleted file mode 100644 index 4709adef..00000000 --- a/mutt/muttrc.m4 +++ /dev/null @@ -1,153 +0,0 @@ -# Names -set use_domain = yes -set use_from = yes -set reverse_name = yes - -# SMTP implementation -set sendmail = 'DOTFILES_SENDMAIL' - -# Mailbox type and location -set mbox_type = 'Maildir' -set folder = 'DOTFILES_MAILDIR' - -# Submailboxes -set spoolfile = '+inbox' -set postponed = '+drafts' -set record = '+sent' -mailboxes ! - -# Addresses -set query_command = 'abook --mutt-query %s' - -# Alerts -set beep_new = yes - -# Attachments -attachments +A */.* -attachments -A text/x-vcard application/pgp.* -attachments -A application/x-pkcs7-.* -attachments +I text/plain -attachments -A message/external-body -attachments -I message/external-body - -# Caching -set header_cache = '~/.cache/mutt/headers' - -# Colors -color attachment brightyellow default -color hdrdefault cyan default -color indicator black white -color markers brightred default -color normal default default -color quoted green default -color signature cyan default -color status default color22 -color tilde brightblack default -color tree default default - -# Completion -bind editor complete-query -bind editor ^T complete - -# Files -set delete = yes -set move = no - -# Flags -set mark_old = no - -# Headers -ignore * -unignore Date From: To Cc Subject -hdr_order Date From: To Cc Subject -set edit_headers = yes - -# Index -set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %s' - -# Interaction -set abort_unmodified = no -set confirmappend = no -set wait_key = no -set quit = ask-yes - -# Intervals -set mail_check = 5 -set sleep_time = 0 - -# Mailboxes -set confirmcreate = yes - -# Menus -set menu_context = 1 - -# MIME -mime_lookup application/octet-stream - -# Pager -set pager_context = 1 -set pager_format = '%4C %Z %[!%b %e at %I:%M %p] %.20n %s%* -- (%P)' -set pager_stop = yes - -# Presentation/formatting -set markers = no -set smart_wrap = yes -set text_flowed = yes -set tilde = yes -alternative_order text/plain text/html * -auto_view text/html - -# Quoting -set quote_regexp = '^(>[ \t]*)+' - -# Responses -set fast_reply = yes -set forward_format = 'Fw: %s' -set include = yes -set use_envelope_from = yes - -# Searching/sorting -set sort = 'threads' -set sort_aux = 'last-date-received' -set strict_threads = yes -set thorough_search = yes - -# SSH -set time_inc=250 - -# Encryption settings -set crypt_replysign = yes -set crypt_replyencrypt = yes -set crypt_replysignencrypted = yes -set crypt_use_gpgme = yes -set crypt_use_pka = yes -set crypt_verify_sig = yes - -# Vim-ish bindings -bind index gg first-entry -bind index G last-entry -bind pager gg top -bind pager G bottom -bind index,pager \Cu half-up -bind index,pager \Cd half-down -bind generic,index,browser,pager \Cf next-page -bind generic,index,browser,pager \Cb previous-page - -# Turn off annoying mailbox lock feature -bind index '%' noop - -# Jump to mailboxes -macro generic,index,browser,pager gi '=inbox' 'Change to inbox folder' -macro generic,index,browser,pager gs '=sent' 'Change to sent folder' - -# Blindly save message to whatever box is suggested -macro index,pager S 's' 'Save message blindly' - -# Run gms to retrieve all mail -macro generic,index,browser,pager gm '!gms --quiet &' 'Run gms' - -# Shortcut to add addresses to abook -macro index,pager A 'abook --add-email' 'Add sender address to abook' - -# Machine or account specific settings -source ~/.mutt/muttrc.local diff --git a/mutt/signature b/mutt/signature deleted file mode 100644 index a229b5f5..00000000 --- a/mutt/signature +++ /dev/null @@ -1,2 +0,0 @@ -Tom Ryder -The next 1<<10 years are ours. diff --git a/vim/after/ftdetect/muttrc.vim b/vim/after/ftdetect/muttrc.vim new file mode 100644 index 00000000..ff3776b5 --- /dev/null +++ b/vim/after/ftdetect/muttrc.vim @@ -0,0 +1,12 @@ +" Add automatic commands to detect .muttrc files +augroup dfmuttrc + + autocmd BufNewFile,BufRead + \ **/.dotfiles/mutt/muttrc.d/*.rc + \ setlocal filetype=muttrc + + autocmd BufNewFile,BufRead + \ **/.muttrc.d/*.rc + \ setlocal filetype=muttrc + +augroup END -- cgit v1.2.3