From 009bd6626ea6e33b59a31a219df628ed0cc5a46c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 22 Jun 2019 19:00:32 +1200 Subject: Move mail ftplugin function out into autoload Now that it isn't called on every load. --- vim/after/ftplugin/mail.vim | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'vim/after') diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 2083aaaf..90278bbe 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -49,30 +49,8 @@ let b:undo_ftplugin .= '|delcommand SuggestStart' SuggestStart " Normalise quoting -function! s:StrictQuote(start, end) abort - let body = 0 - for lnum in range(a:start, a:end) - - " Get current line - let line = getline(lnum) - - " Get the leading quote string, if any; skip if there isn't one - let quote = matchstr(line, '^>[> ]*') - if !strlen(quote) - continue - endif - - " Normalise the quote with no spaces - let quote = substitute(quote, '[^>]', '', 'g') - - " Re-set the line - let line = substitute(line, '^[> ]\+', quote, '') - call setline(lnum, line) - - endfor -endfunction command -buffer -bar -range=% StrictQuote - \ call s:StrictQuote(, ) + \ call mail#StrictQuote(, ) nnoremap s \ :StrictQuote xnoremap s -- cgit v1.2.3