setlocal textwidth=65
" Remove trailing whitespace after quotes.
-silent! %s/\(^>.\{-}\)\@<=\s\+$//
+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 }
+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,