+setlocal textwidth=65
+
+" Remove trailing whitespace after quotes.
+silent! %s/^>.\{-}\zs\s\+$//
+" Remove spaces between quotes (> > to >>).
+silent! %s/^>\+\zs >/>/g
+silent! %s/^>\+\zs >/>/g
+silent! %s/^>\+\zs >/>/g
+
+" Move directly after the headers.
+normal! gg
+normal! }
+" And if the mail contains a reply move the cursor after the quote.
+if search('^On .\+ wrote:$', 'n')
+ normal! }
+endif
+
+" Fold quotes. Thanks to Teemu Likonen <tlikonen@iki.fi>
+" (http://permalink.gmane.org/gmane.editors.vim.devel/20890,
+" <20080809190407.GA7584@mithlond.arda.local>) and danielsh_ in #mutt on
+" Freenode (2010-07-10 13:01 CEST) for letting me know.
+setlocal foldmethod=expr foldminlines=2
+setlocal foldexpr=strlen(substitute(substitute(getline(v:lnum),'\\s','','g'),'[^>].*','',''))