diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-14 19:39:31 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-14 19:39:31 +1200 |
commit | 582f503ba5d669170fdb8033618f4efe2e89b148 (patch) | |
tree | d7beea83ef6eb8e407e1e56888d885f0a7768ced /vim/after | |
parent | Use more idiomatic check for empty string (diff) | |
download | dotfiles-582f503ba5d669170fdb8033618f4efe2e89b148.tar.gz dotfiles-582f503ba5d669170fdb8033618f4efe2e89b148.zip |
Wrap mail starting point guesser in command-func
Diffstat (limited to 'vim/after')
-rw-r--r-- | vim/after/ftplugin/mail.vim | 8 |
1 files changed, 5 insertions, 3 deletions
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 |