diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-16 13:46:10 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-16 13:46:10 +1200 |
commit | 009b0efd84118d4ce3ffcf2fdc400477326f4f30 (patch) | |
tree | 63d5affd378d7a6ba646d1bb1fdd78555f3796e8 /vim/autoload/quote.vim | |
parent | Don't default <Plug>(InsertCancel) (diff) | |
download | dotfiles-009b0efd84118d4ce3ffcf2fdc400477326f4f30.tar.gz dotfiles-009b0efd84118d4ce3ffcf2fdc400477326f4f30.zip |
Add reformatting analogue to quote mappings
Diffstat (limited to 'vim/autoload/quote.vim')
-rw-r--r-- | vim/autoload/quote.vim | 12 |
1 files changed, 12 insertions, 0 deletions
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 |