aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-16 13:46:10 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-16 13:46:10 +1200
commit009b0efd84118d4ce3ffcf2fdc400477326f4f30 (patch)
tree63d5affd378d7a6ba646d1bb1fdd78555f3796e8 /vim/autoload
parent5a88a073fb2a1efeef8363b878f5582b3bd9997a (diff)
downloaddotfiles-009b0efd84118d4ce3ffcf2fdc400477326f4f30.tar.gz
dotfiles-009b0efd84118d4ce3ffcf2fdc400477326f4f30.zip
Add reformatting analogue to quote mappings
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/quote.vim12
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