]> 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 8b320aa6b562a2fff4e55fad551407df7db8b65f..5270ae7eb930c7162afe9e186c5c57313fbe1306 100644 (file)
@@ -2,18 +2,33 @@
 "
 " Language:     Mail
 " Maintainer:   Simon Ruderich <simon@ruderich.org>
+" License:      GPL v3+
+
+" Copyright (C) 2009-2012  Simon Ruderich
+"
+" This file is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" This file is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with this file.  If not, see <http://www.gnu.org/licenses/>.
 
 
 " 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