aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:45:40 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:45:40 +1200
commitd2dea390b4644c72716f0495c53dfce72b77121f (patch)
tree65104ec49d70bd2f981312989a451825afa491f6 /vim
parentb4c127d40a7acaafd7b94d1901b59da9db0265de (diff)
downloaddotfiles-d2dea390b4644c72716f0495c53dfce72b77121f.tar.gz
Delete blank lines at top of quoted reply
Diffstat (limited to 'vim')
-rw-r--r--vim/after/ftplugin/mail.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 39999075..fd2c9705 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -10,10 +10,17 @@ if line('.') == 1 && col('.') == 1
" no quote, which is fine
call search('\m^>', 'c')
+ " Delete quoted blank lines until we get to something with substance
+ while getline('.') =~# '^>\s*$'
+ delete
+ endwhile
+
" Check this line to see if it's a generic hello or hello-name greeting that
" we can just strip out; delete any following lines too, if they're blank
if getline('.') =~? '^>\s*\%(<hello\|hey\+\|hi\)\%(\s\+\S\+\)\=[,;]*\s*$'
delete
+
+ " Delete quoted blank lines again
while getline('.') =~# '^>\s*$'
delete
endwhile