From 009b0efd84118d4ce3ffcf2fdc400477326f4f30 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 16 Jul 2018 13:46:10 +1200 Subject: Add reformatting analogue to quote mappings --- vim/autoload/quote.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vim/autoload') diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim index 6e943091..26e95698 100644 --- a/vim/autoload/quote.vim +++ b/vim/autoload/quote.vim @@ -28,3 +28,15 @@ function! quote#QuoteOpfunc(type) abort endfor endfunction + +" Tack on reformatting the edited text afterwards +function! quote#QuoteReformat() abort + set operatorfunc=quote#QuoteReformatOpfunc + return 'g@' +endfunction + +" Wrapper operator function to reformat quoted text afterwards +function! quote#QuoteReformatOpfunc(type) abort + call quote#QuoteOpfunc(a:type) + normal! '[gq'] +endfunction -- cgit v1.2.3