]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vim/after/ftplugin/mail.vim
after/ftplugin/mail: Try to clean up mails.
[config/dotfiles.git] / vim / after / ftplugin / mail.vim
index 52ba5052b7645be24233797a0627ac6705b110d4..3005e25332f509ece6bf16c556c21ad534661f0a 100644 (file)
@@ -5,4 +5,15 @@
 
 
 " Use only 65 characters per line as given in rfc1855.
-set textwidth=65
+setlocal textwidth=65
+
+" Replace trailing spaces except after mail headers (To:, etc.) or a signature
+" delimiter (-- ).
+silent! %s/\(^\([a-zA-z-]\+:\|--\)\)\@<!\s\+$//
+" Remove spaces between quotes (> > to >>).
+silent! %s/^\(>\+\) >/\1>/g
+silent! %s/^\(>\+\) >/\1>/g
+
+" Move directly after the headers.
+normal gg
+normal }