config: set a default filter for text/plain

Avoid the following issue when running aerc with the default
configuration:

  No filter configured for this mimetype ('text/plain')

Use a very basic sed command to replace the default plaintext filter.

Fixes: bb0f180140 ("config: do not hardcode sharedir")
Signed-off-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Robin Jarry 2022-02-19 22:11:06 +01:00
parent 5abc3cab96
commit 7c3ce816c8
2 changed files with 1 additions and 16 deletions

View file

@ -222,6 +222,7 @@ reply-to-self=true
# against (non-case-sensitive) and a comma, e.g. subject,text will match a
# subject which contains "text". Use header,~regex to match against a regex.
#subject,~^\[PATCH=colordiff
text/plain=sed 's/^>\+.*/\x1b[2;36m&\x1b[0m/'
#text/html=pandoc -f html -t plain
#image/*=catimg -w $(tput cols) -

View file

@ -1,16 +0,0 @@
# vim: set ft=awk :
BEGIN {
dim = "\x1B[2m"
cyan = "\x1B[36m"
reset = "\x1B[0m"
}
{
# Strip carriage returns from line
gsub(/\r/, "", $0)
if ($0 ~ /^On .*, .* wrote:/ || $0 ~ /^>+/) {
print dim cyan $0 reset
} else {
print $0
}
}