]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vim/after/ftplugin/mail.vim
ftplugin/mail.vim: Simplify regex to remove trailing whitespace.
[config/dotfiles.git] / vim / after / ftplugin / mail.vim
index 2c44531ac2b9dca18fe677f4084826c27467e549..94af0bce972c0dc10e0a568c9885b9350562b232 100644 (file)
@@ -4,7 +4,7 @@
 " Maintainer:   Simon Ruderich <simon@ruderich.org>
 " License:      GPL v3+
 
-" Copyright (C) 2009-2012  Simon Ruderich
+" Copyright (C) 2009-2013  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
 " Use only 65 characters per line as given in rfc1855.
 setlocal textwidth=65
 
-" Replace trailing whitespace after quotes.
-silent! %s/\(^>.\+\)\@<=\s\+$//
+" Remove trailing whitespace after quotes.
+silent! %s/^>.\{-}\zs\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
@@ -37,6 +37,6 @@ normal }
 " Fold quotes. Thanks to Teemu Likonen <tlikonen@iki.fi>
 " (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.
+" Freenode (2010-07-10 13:01 CEST) for letting me know.
 setlocal foldmethod=expr foldminlines=2
 setlocal foldexpr=strlen(substitute(substitute(getline(v:lnum),'\\s','','g'),'[^>].*','',''))