aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/mail.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:57:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:57:52 +1200
commit25989141c2ec675ce4b63fff6025776596c1ff5b (patch)
treed8148c9b94ed16ebe2cba7ef765f471c6651c6ef /vim/after/ftplugin/mail.vim
parent5c31ba982a084dd55d232a9ebea5551f1d4f7455 (diff)
parent37ab0d3e9799924f14f55c09104e45c218fd6402 (diff)
downloaddotfiles-25989141c2ec675ce4b63fff6025776596c1ff5b.tar.gz
dotfiles-25989141c2ec675ce4b63fff6025776596c1ff5b.zip
Merge branch 'release/v4.42.0'v4.42.0
* release/v4.42.0: Bump VERSION Delete blank lines at top of quoted reply Don't add spaces when quoting mail Make space appending for quote indent configurable Use get() for mail buffer variable fetch
Diffstat (limited to 'vim/after/ftplugin/mail.vim')
-rw-r--r--vim/after/ftplugin/mail.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index e01872d6..fd2c9705 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,3 +1,7 @@
+" Don't append spaces after quote chars, for strict compliance with
+" format=flowed
+let b:quote_space = 0
+
" If something hasn't already moved the cursor, we'll move to an optimal point
" to start writing
if line('.') == 1 && col('.') == 1
@@ -6,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