[neomutt-users] Search and Replace for viewing Mail
Florian Wehner
florian at whnr.de
Fri Mar 15 15:40:48 CET 2019
Hi Rich!
>> ... search and replace on e-mail bodies in the pager
>
>Sounds like you want $display_filter
> https://neomutt.org/guide/reference#display-filter
>
>Here's a sample to eliminate the letter 'e' from your email :-)
> set display_filter="sed 's/e//g'"
Thank you! That's it. I just could not find it in the docs. What I
really needed was: `sed -E 's/[aeiou]/a/g'` => great fun for 3 minutes
:-)
Just as a reference, here is what I have in my neomuttrc now. And just
to be sure: I know, that the URL and E-Mail regexes are very weak. But
it's enough for everything I have seen so far.
# Stripping URLs and extra e-mail parameters from the displayed text
# Backslashes must be double escaped in neomutt variables!
set display_filter="sed -E -e 's/https?:\\/\\/[^ \\n\\r\\t]+\\b/\\[url\\]/g' \
-e 's/(mailto:)?([-a-zA-Z0-9._]+@[-a-zA-Z0-9._]{3,})(\\?.*)?\\b/\\2/g'"
color body color9 default "\\[url\\]"
--Florian
More information about the neomutt-users
mailing list