From 4ab05e738aefd648f047b1d3bc1f443bde3f2671 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 20 Sep 2025 23:15:33 +0200 Subject: [PATCH] aerc: Add configuration to replace neomutt usage Starting to replace neomutt in my workflow with aerc: it is a little more lightweight, directly supports notmuch directories and has a relatively sane configuration style (mostly just ini-like) with 'go-templating' baked in. In general, the configuration just feels less 'cobbled-together' than before. I can make changes without worrying what other things are going to break by doing so. I understand the complete configuration and styling, instead of mostly relying on other people's formatting lines for the styles. I am still learning some of the configuration possibilities but it already functions as a neomutt replacement. --- office/.config/aerc/aerc.conf | 68 +++++++++ office/.config/aerc/binds.conf | 218 +++++++++++++++++++++++++++ office/.config/aerc/stylesets/simple | 14 ++ 3 files changed, 300 insertions(+) create mode 100644 office/.config/aerc/aerc.conf create mode 100644 office/.config/aerc/binds.conf create mode 100644 office/.config/aerc/stylesets/simple diff --git a/office/.config/aerc/aerc.conf b/office/.config/aerc/aerc.conf new file mode 100644 index 0000000..60361ce --- /dev/null +++ b/office/.config/aerc/aerc.conf @@ -0,0 +1,68 @@ +[general] +enable-osc8 = true + +[ui] +dirlist-tree = true +fuzzy-complete = true +dialog-position = bottom + +styleset-name = simple + +index-columns = flags>4,name<20%,subject,date>= +this-week-time-format = Mon 02 +sidebar-width = 15 + +threading-enabled = true +reverse-thread-order = true +show-thread-context = true +thread-prefix-folded = "+ " +thread-prefix-tip = "" +thread-prefix-indent = "" +thread-prefix-stem = "│" +thread-prefix-limb = "─" +thread-prefix-folded = "+" +thread-prefix-unfolded = "" +thread-prefix-first-child = "┬" +thread-prefix-has-siblings = "├" +thread-prefix-orphan = "┌" +thread-prefix-dummy = "┬" +thread-prefix-lone = " " +thread-prefix-last-sibling = "╰" + +[statusline] +column-left = [{{.Account}}] {{cwd}} {{.ContentInfo}} +column-right = {{.TrayInfo}} | {{dateFormat now "Mon Jan 2 15:04:05 2006"}} + +[viewer] + +[compose] +file-picker-cmd = vifm --choose-files - +reply-to-self = false +empty-subject-warning = true +no-attachment-warning = ^[^>]*(attach(ed|ment)|an(ge)?hang) + +[multipart-converters] +text/html=pandoc -f commonmark_x -t html --standalone --embed-resources --template email +# TODO: change to djot when new pandoc version in repos + +[filters] +.filename,~.*.ics = calendar +text/plain = wrap -w 100 | colorize +text/calendar = calendar +message/delivery-status = colorize +message/rfc822 = colorize +text/html = pandoc -f html -t plain +application/pdf = pdftotext - -l 10 -nopgbrk -q - | wrap -w 100 +application/msword = pandoc -f docx -t plain +application/vnd.openxmlformats-officedocument.wordprocessingml.document = pandoc -f docx -t plain +application/vnd.oasis.opendocument.text = pandoc -f odt -t plain +.headers = colorize +# text/html = ! html # ! for interactive applications + +[openers] +# does not have filename checking for openers? +.filename,~.*.ics = wezterm -e nvim - + +[hooks] + +[templates] diff --git a/office/.config/aerc/binds.conf b/office/.config/aerc/binds.conf new file mode 100644 index 0000000..9400cbd --- /dev/null +++ b/office/.config/aerc/binds.conf @@ -0,0 +1,218 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit +gT = :prev-tab +gt = :next-tab + = :prev-tab + = :next-tab +\[t = :prev-tab +\]t = :next-tab + = :term +? = :help keys + = :prompt 'Quit?' quit + = :prompt 'Quit?' quit + = :suspend + +[messages] +q = :quit # quick quitting + +j = :next +\]m = :next + = :next + = :next 50% + = :next 100% + +k = :prev +\[m = :prev + = :prev + = :prev 50% + = :prev 100% +gg = :select 0 +G = :select -1 + +\]e = :next-folder +\[e = :prev-folder +\}e = :next-folder -u +\{e = :prev-folder -u + = :next-folder + = :prev-folder +H = :collapse-folder +L = :expand-folder + = :collapse-folder + = :expand-folder + +gi = :cf Inbox +gs = :cf Sent +gd = :cf Drafts +ga = :cf Archive +gA = :cf All +gr = :cf Trash + +v = :mark -t +V = :mark -V +J = :mark -t:next +K = :mark -t:prev +T = :prompt "Mark filter: " :mark + +zt = :toggle-threads +zc = :fold +zC = :fold -a +zo = :unfold +zO = :unfold -a +za = :fold -t +zA = :fold -t -a + +zz = :align center +zt = :align top +zb = :align bottom + + = :view +l = :view + +# remove filters +/ = :filter +\ = :filter +,F = :tag +,s = :tag !unread +,u = :tag !urgent +,d = :tag !todo +,i = :tag !important +,f = :tag !flagged +,w = :tag !wait +,l = :tag !delegated +,j = :tag !junk +,J = :tag !junk:archive flat # archive message as junk +s = :filter tag:unread +u = :filter tag:urgent +d = :filter tag:todo +i = :filter tag:important or tag:flagged +f = :filter tag:flagged +w = :filter tag:wait +l = :filter tag:delegated + +d = :move Trash +D = :choose -o y 'Really delete this message' :delete +a = :archive flat # archive message +A = :unmark -a:mark -T:archive flat # archive thread +M = :menu -d :move # move mail + +m = :compose +f = :forward +F = :bounce +rr = :reply -a +rq = :reply -aq +rR = :reply +rQ = :reply -q + +c = :cf +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + = :clear + +s = :split +S = :vsplit + +# send mails to taskwarrior +,t = :pipe -s -m neomutt-2task -c -d -t +,T = :pipe -s -m neomutt-2task -c + +# # TODO: Investigate use +# pl = :patch list +# pa = :patch apply +# pd = :patch drop +# pb = :patch rebase +# pt = :patch term +# ps = :patch switch + +[messages:folder=Drafts] +m = :recall +[messages:folder=Trash] +d = :choose -o y 'Really delete this message' :delete +D = :delete + +[view] +/ = :toggle-key-passthrough/ +q = :close +h = :close +O = :open +o = :open +S = :menu -c 'vifm --choose-dir - --on-choose exit' :save # save current with +| = :pipe + +d = :move Trash +D = :choose -o y 'Really delete this message' :delete +a = :archive flat # archive message +A = :unmark -a:mark -T:archive flat # archive thread +M = :menu -d :move # move mail + + = :copy-link + = :open-link + +m = :compose +f = :forward +F = :bounce +rr = :reply -a +rq = :reply -aq +rR = :reply +rQ = :reply -q + +H = :toggle-headers +J = :next-part +K = :prev-part + = :prev-part + = :next-part + = :next + = :prev + = :next + = :prev + +tr = :pipe trans -show-original n -b -no-autocorrect # translate message + +[view::passthrough] +$noinherit = true +$ex = + = :toggle-key-passthrough + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose view +$noinherit = true +$ex = +$complete = + = :prev-field + = :next-field + = :prev-field + = :next-field + = :next-field + = :prev-field + = :switch-account -p + = :switch-account -n + = :switch-account -p + = :switch-account -n + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + +[compose::review] +# Keybindings used when reviewing a message to be sent +# Inline comments are used as descriptions on the review screen +y = :send # Send +n = :abort # Abort (discard message, no confirmation) +s = :sign # Toggle signing +x = :encrypt # Toggle encryption to all recipients +v = :preview # Preview message +p = :postpone # Postpone +q = :choose -o d discard abort -o p postpone postpone # Abort or postpone +e = :edit # Edit (body and headers) +a = :attach -m # Add attachment +d = :detach # Remove attachment + +[terminal] +$noinherit = true +$ex = diff --git a/office/.config/aerc/stylesets/simple b/office/.config/aerc/stylesets/simple new file mode 100644 index 0000000..66e8165 --- /dev/null +++ b/office/.config/aerc/stylesets/simple @@ -0,0 +1,14 @@ +# vim: ft=dosini +# +# aerc default styleset +# +# This styleset uses the terminal defaults as its base, by not setting anything. +# For more details see the 'default' styleset in aerc, or the +# aerc-stylesets(7) manpage. + +[user] +attention.fg = 1 +accent.fg = 4 +highlight.fg = 3 +subdued.fg = 2 +subdued.dim = true