From df8fe4a34e65f049af82f51f17915903035f2c4b Mon Sep 17 00:00:00 2001 From: Harm te Hennepe Date: Tue, 20 Oct 2015 16:34:45 +0200 Subject: [PATCH] Make using the %-sign in Latex-Box a jump motion --- ftplugin/latex-box/motion.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ftplugin/latex-box/motion.vim b/ftplugin/latex-box/motion.vim index 66b9e4f..62c0a8d 100644 --- a/ftplugin/latex-box/motion.vim +++ b/ftplugin/latex-box/motion.vim @@ -56,6 +56,10 @@ endfunction " Finding Matching Pair {{{ function! s:FindMatchingPair(mode) + if a:mode =~ 'n\|v\|o' + let oldpos = getpos('.') + endif + if a:mode =~ 'h\|i' 2match none elseif a:mode == 'v' @@ -161,6 +165,14 @@ function! s:FindMatchingPair(mode) endfor endif + + if a:mode =~ 'n\|v\|o' + let newpos = getpos('.') + call setpos('.', oldpos) + normal! m' + call setpos('.', newpos) + endif + endfunction " Allow to disable functionality if desired