From 582f503ba5d669170fdb8033618f4efe2e89b148 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 14 Jun 2019 19:39:31 +1200 Subject: Wrap mail starting point guesser in command-func --- vim/after/ftplugin/mail.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vim/after/ftplugin') diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 2894ec2b..d9a24082 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -4,7 +4,7 @@ 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 +function! s:SuggestStart() abort " Start by trying to move to the first quoted line; this may fail if there's " no quote, which is fine @@ -35,8 +35,10 @@ if line('.') == 1 && col('.') == 1 " Now move to the first quoted or unquoted blank line call search('\m^>\= *$', 'c') - -endif +endfunction +command! -bar -buffer SuggestStart + \ call s:SuggestStart() +SuggestStart " Normalise quoting let body = 0 -- cgit v1.2.3