aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-13 13:25:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-13 13:25:13 +1200
commit587de04765e69f3e32aa2067303322fa841c64b3 (patch)
tree1dcf6b5198fe8dbfdf52fff06b5674dcd1858065 /vim
parent054f1b81d469dc8d153f03b04c2eee0bfc980414 (diff)
downloaddotfiles-587de04765e69f3e32aa2067303322fa841c64b3.tar.gz
dotfiles-587de04765e69f3e32aa2067303322fa841c64b3.zip
Move to after headers when writing new mail
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 3ecc0310..fa1b9443 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -3,6 +3,13 @@ if &filetype !=# 'mail' || v:version < 700
finish
endif
+" We will almost always want to start editing after the headers, so move to
+" the first entirely blank line, if something hasn't already moved us from the
+" start of the file
+if line('.') == 1 && col('.') == 1
+ call search('^$', 'c')
+endif
+
" Add a space to the end of wrapped lines for format-flowed mail
setlocal formatoptions+=w
let b:undo_ftplugin .= '|setlocal formatoptions<'