]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vim/after/ftplugin/mail.vim
after/ftplugin/mail.vim: Fix regex to remove spaces after quotes.
[config/dotfiles.git] / vim / after / ftplugin / mail.vim
index b0fee0cb0991f48e2c08ac1e6847b1bf1c736de6..5270ae7eb930c7162afe9e186c5c57313fbe1306 100644 (file)
 " 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-]\+:\|--\)\)\@<!\s\+$//
+" Replace trailing whitespace after quotes.
+silent! %s/\(^>.\{-}\)\@<=\s\+$//
 " Remove spaces between quotes (> > to >>).
-silent! %s/^\(>\+\) >/\1>/g
-silent! %s/^\(>\+\) >/\1>/g
-silent! %s/^\(>\+\) >/\1>/g
+silent! %s/^>\+\zs >/>/g
+silent! %s/^>\+\zs >/>/g
+silent! %s/^>\+\zs >/>/g
 
 " Move directly after the headers.
 normal gg