X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vim%2Fafter%2Fftplugin%2Fmail.vim;h=2dc85d828a4ef1fb9fbddb22fd89b61b53dd3341;hb=f6eefdd7a7a55b306c8c5d0c912609e942acd63d;hp=5129509b9a572633c69cb0853e4be0db375816c5;hpb=44bd7f52a0245409d50a98a43dfba618f506f9f8;p=config%2Fdotfiles.git diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 5129509..2dc85d8 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -1,8 +1,26 @@ " Vim filetype plugin file " Language: Mail " Maintainer: Simon Ruderich -" Last Change: 2008-12-07 " Use only 65 characters per line as given in rfc1855. setlocal textwidth=65 + +" Replace trailing spaces except after mail headers (To:, etc.) or a signature +" delimiter (-- ). +silent! %s/\(^\([a-zA-z-]\+:\|--\)\)\@ > to >>). +silent! %s/^\(>\+\) >/\1>/g +silent! %s/^\(>\+\) >/\1>/g +silent! %s/^\(>\+\) >/\1>/g + +" Move directly after the headers. +normal gg +normal } + +" Fold quotes. Thanks to Teemu Likonen +" (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) for letting me know. +setlocal foldmethod=expr foldminlines=2 +setlocal foldexpr=strlen(substitute(substitute(getline(v:lnum),'\\s','','g'),'[^>].*','',''))