format=flowed convention, specified in RFC 3676 is a way of
formatting text-based messages so that they can be displayed nicely
independently of the screen’s (or terminal’s) width. The core of the
convention, roughly, is to distinguish soft line breaks, which the
displaying software is free to re-arrange (and which are marked by a trailing
space character), from hard line breaks, which are meant to always be
See the above-mentioned RFC for more details on the format. The point of
this short note is to explain how to configure the Neomutt mail client, along with the Vim editor, to use the
Neomutt really needs only one configuration tweak in order to use
format=flowed. Simply add the following line to the
neomutt.rc configuration file:
This will instruct Neomutt to add the
Content-Type header of newly generated mails.
Add the following line to the
au BufNewFile,BufRead neomutt-* setf mail
This will lead Vim to use the mail filetype anytime it edits a
file whose name starts with
neomutt-, which will happen when the
editor is fired from Neomutt to compose a message.
Then create a
~/.vim/after/ftplugin/mail.vim file, with the
setl tw=72 setl fo=awq setl comments+=nb:> match ErrorMsg '\s\+$'
The first line sets the maximal line length to 72 characters. The second
enables automatic formatting of paragraphs, with a trailing white space
indicating a paragraph continues in the next line. The third line specifies
that lines starting with
> are “comments” (so that quotes
within a mail can be displayed differently from the rest of the message).
Finally, the last line allows to highlight the trailing space at the end of broken lines, to provide a visual distinction between “soft” and “hard” line breaks.