From 0ba77f2f31c9de42f1e7a8435e6322d3f0a04fa5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 16 Oct 2021 17:07:40 +0200 Subject: vim-patch:2286304cdbba Update runtime files https://github.com/vim/vim/commit/2286304cdbba53ceb52b3ba2ba4a521b0a2f8d0f --- runtime/ftplugin/context.vim | 67 +++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 26 deletions(-) (limited to 'runtime/ftplugin/context.vim') diff --git a/runtime/ftplugin/context.vim b/runtime/ftplugin/context.vim index 10f1ae1648..37f7240d7b 100644 --- a/runtime/ftplugin/context.vim +++ b/runtime/ftplugin/context.vim @@ -2,7 +2,7 @@ " Language: ConTeXt typesetting engine " Maintainer: Nicola Vitacolonna " Former Maintainers: Nikolai Weibull -" Latest Revision: 2016 Oct 30 +" Latest Revision: 2021 Oct 15 if exists("b:did_ftplugin") finish @@ -17,7 +17,6 @@ if !exists('current_compiler') endif let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<" - \ . "| unlet! b:match_ignorecase b:match_words b:match_skip" setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2 if get(b:, 'context_metapost', get(g:, 'context_metapost', 1)) @@ -35,11 +34,12 @@ let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)' setlocal suffixesadd=.tex -if exists("loaded_matchit") +if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_skip = 'r:\\\@ [[ :call move_around(v:count1, "beginsection", "bW", v:false) -vnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:true) -nnoremap ]] :call move_around(v:count1, "beginsection", "W", v:false) -vnoremap ]] :call move_around(v:count1, "beginsection", "W", v:true) -nnoremap [] :call move_around(v:count1, "endsection", "bW", v:false) -vnoremap [] :call move_around(v:count1, "endsection", "bW", v:true) -nnoremap ][ :call move_around(v:count1, "endsection", "W", v:false) -vnoremap ][ :call move_around(v:count1, "endsection", "W", v:true) -nnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:false) -vnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:true) -nnoremap ]} :call move_around(v:count1, "endblock", "W", v:false) -vnoremap ]} :call move_around(v:count1, "endblock", "W", v:true) +if !exists("no_plugin_maps") && !exists("no_context_maps") + " Move around macros. + nnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:false) + vnoremap [[ :call move_around(v:count1, "beginsection", "bW", v:true) + nnoremap ]] :call move_around(v:count1, "beginsection", "W", v:false) + vnoremap ]] :call move_around(v:count1, "beginsection", "W", v:true) + nnoremap [] :call move_around(v:count1, "endsection", "bW", v:false) + vnoremap [] :call move_around(v:count1, "endsection", "bW", v:true) + nnoremap ][ :call move_around(v:count1, "endsection", "W", v:false) + vnoremap ][ :call move_around(v:count1, "endsection", "W", v:true) + nnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:false) + vnoremap [{ :call move_around(v:count1, "beginblock", "bW", v:true) + nnoremap ]} :call move_around(v:count1, "endblock", "W", v:false) + vnoremap ]} :call move_around(v:count1, "endblock", "W", v:true) + + let b:undo_ftplugin .= " | sil! exe 'nunmap [[' | sil! exe 'vunmap [['" . + \ " | sil! exe 'nunmap ]]' | sil! exe 'vunmap ]]'" . + \ " | sil! exe 'nunmap []' | sil! exe 'vunmap []'" . + \ " | sil! exe 'nunmap ][' | sil! exe 'vunmap ]['" . + \ " | sil! exe 'nunmap [{' | sil! exe 'vunmap [{'" . + \ " | sil! exe 'nunmap ]}' | sil! exe 'vunmap ]}'" +end " Other useful mappings if get(g:, 'context_mappings', 1) @@ -81,16 +90,22 @@ if get(g:, 'context_mappings', 1) call cursor(search(s:tp_regex, 'W') - 1, 1) endf - " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") - onoremap tp :call tp() - " Select TeX paragraph - vnoremap tp :call tp() - - " $...$ text object - onoremap i$ :normal! T$vt$ - onoremap a$ :normal! F$vf$ - vnoremap i$ T$ot$ - vnoremap a$ F$of$ + if !exists("no_plugin_maps") && !exists("no_context_maps") + " Reflow paragraphs with commands like gqtp ("gq TeX paragraph") + onoremap tp :call tp() + " Select TeX paragraph + vnoremap tp :call tp() + + " $...$ text object + onoremap i$ :normal! T$vt$ + onoremap a$ :normal! F$vf$ + vnoremap i$ T$ot$ + vnoremap a$ F$of$ + + let b:undo_ftplugin .= " | sil! exe 'ounmap tp' | sil! exe 'vunmap tp'" . + \ " | sil! exe 'ounmap i$' | sil! exe 'vunmap i$'" . + \ " | sil! exe 'ounmap a$' | sil! exe 'vunmap a$'" + endif endif " Commands for asynchronous typesetting -- cgit