aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/mail.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-30 20:23:43 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-30 20:23:43 +1300
commit78b3b3e49b8dc8286a3059e4b3a5bc11214c9a5d (patch)
tree32ff337ee16af906b36b4c4a1928bad4a809839e /vim/after/ftplugin/mail.vim
parentSpecify encoding of file with ZALGO comment (diff)
downloaddotfiles-78b3b3e49b8dc8286a3059e4b3a5bc11214c9a5d.tar.gz
dotfiles-78b3b3e49b8dc8286a3059e4b3a5bc11214c9a5d.zip
Move ft=mail start suggestion to autoload
Diffstat (limited to 'vim/after/ftplugin/mail.vim')
-rw-r--r--vim/after/ftplugin/mail.vim41
1 files changed, 1 insertions, 40 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 9f8fc608..200234c6 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -3,47 +3,8 @@
let b:quote_space = 0
let b:undo_ftplugin .= '|unlet b:quote_space'
-" Attempt to move to a good spot to start writing
-function! s:SuggestStart() abort
-
- " Move to top of buffer
- call setpos('.', [0, 1, 1, 0])
-
- " Move to body text
- call search('\m^$', 'c') | +
-
- " Start by trying to move to the first quoted line; this may fail if there's
- " no quote, which is fine
- call search('\m^>', 'c')
-
- " Delete quoted blank lines or quoted greetings until we get to something
- " with substance. Yes, I like Perl, how could you tell?
- while getline('.') =~? '^> *'
- \ . '\%('
- \ . '\%('
- \ . 'g[''\u2019]\=day'
- \ . '\|\%(good \)\=\%(morning\|afternoon\|evening\)'
- \ . '\|h[eu]\%(ll\|rr\)o\+'
- \ . '\|hey\+'
- \ . '\|hi\+'
- \ . '\|sup'
- \ . '\|what[''\u2019]\=s up'
- \ . '\|yo'
- \ . '\)'
- \ . '[[:punct:] ]*'
- \ . '\%('
- \ . '\a\+'
- \ . '[[:punct:] ]*'
- \ . '\)\='
- \ . '\)\=$'
- delete
- endwhile
-
- " Now move to the first quoted or unquoted blank line
- call search('\m^>\= *$', 'c')
-endfunction
command! -bar -buffer SuggestStart
- \ call s:SuggestStart()
+ \ call mail#SuggestStart()
let b:undo_ftplugin .= '|delcommand SuggestStart'
SuggestStart