On 18.09.15 10:41, Cameron Simpson wrote:
> I'm pretty sure the vim mode I'm using doesn't do quoting correctly
> if I edit the quoted sections. Need to check that on my end.

While editing a mutt tmp file, it can be useful to set something like:

set formatoptions=qrjl

The 'q' causes (multiple levels of) quoting to be respected.
The 'r' allows a <CR> to be inserted before a quoted sentence, to move
it to a new line, _auto_quoted_. (I.e. preserving its status)
The 'j' causes elision of the quoting when two short lines are joined.
(Only preserves the sense if the two are at the same quoting level.)
There is no 'o', because <open> is more useful for inserting unquoted
text, i.e. in-line replies.
The 'l' stops breaking of long lines in insert mode, allowing
"textwidth" to be deliberately exceeded. (YMMV)

> Things are further complicated by receive messages from people not
> using format=flowed. I probably need to incorporate their quotes
> differently depending

In either case, here, vim (in mutt) manually reflows a paragraph of
quoted text to "textwidth", respecting (multiple levels of) quoting,
with "gq}". (Mine's automatically set to 72 when I'm in mutt.)

Admittedly recognition of a quoted paragraph requires prior deletion of
the quoting ">" on the inter-paragraph blank line, and reflowing all of
the quote is a pain if there's character art.

So, in .vimrc, something vaguely like:

au BufNewFile,BufRead   ~/Desktop/mutt-*   call Set_for_mutt()

function! Set_for_mutt()
set textwidth=72 foldmethod=manual
set formatoptions=qrjl

" Change subthread Subject:
noremap <A-w> ^[gg/Re:^Mce[Was^[A]^[0Wi
endfunction

And in .muttrc:

set tmpdir="~/Desktop"

to provide some chance of preserving a half-finished post in the event
of a crash.

Optional in .vimrc:

noremap ^W gq}

Where ^W is a a Ctr-W, saving some typing every time we reflow.

Trimming to the sentence level with "d)" is more convenient in quoted
text when it can easily be reflowed afterwards.

Automatic reflowing is possible, with 'a', but that's too scary.

Erik

-- 
Give a man a computer program and you give him a headache, but teach him
to program computers and you give him the power to create headaches for
others for the rest of his life.                      - R. B. Forest

Reply via email to