if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1 " LaTeX Box mappings if exists("g:LatexBox_no_mappings") finish endif " latexmk {{{ noremap ll :Latexmk noremap lL :Latexmk! noremap lc :LatexmkClean noremap lC :LatexmkClean! noremap lg :LatexmkStatus noremap lG :LatexmkStatus! noremap lk :LatexmkStop noremap le :LatexErrors " }}} " View {{{ noremap lv :LatexView " }}} " TOC {{{ noremap lt :LatexTOC " }}} " List of labels {{{ noremap lj :LatexLabels " }}} " Folding {{{ if g:LatexBox_Folding == 1 noremap lf :LatexFold endif " }}} " Jump to match {{{ if !exists('g:LatexBox_loaded_matchparen') nmap % LatexBox_JumpToMatch vmap % LatexBox_JumpToMatch omap % LatexBox_JumpToMatch endif " }}} " Define text objects {{{ vmap ie LatexBox_SelectCurrentEnvInner vmap ae LatexBox_SelectCurrentEnvOuter onoremap ie :normal vie onoremap ae :normal vae vmap i$ LatexBox_SelectInlineMathInner vmap a$ LatexBox_SelectInlineMathOuter onoremap i$ :normal vi$ onoremap a$ :normal va$ " }}} " Jump between sections {{{ function! s:LatexBoxNextSection(type, backwards, visual) " Restore visual mode if desired if a:visual normal! gv endif " For the [] and ][ commands we move up or down before the search if a:type == 1 if a:backwards normal! k else normal! j endif endif " Define search pattern and do the search while preserving "/ let save_search = @/ let flags = 'W' if a:backwards let flags = 'b' . flags endif let notcomment = '\%(\%(\\\@' call search(pattern, flags) let @/ = save_search " For the [] and ][ commands we move down or up after the search if a:type == 1 if a:backwards normal! j else normal! k endif endif endfunction noremap ]] :call LatexBoxNextSection(0,0,0) noremap ][ :call LatexBoxNextSection(1,0,0) noremap [] :call LatexBoxNextSection(1,1,0) noremap [[ :call LatexBoxNextSection(0,1,0) vnoremap ]] :call LatexBoxNextSection(0,0,1) vnoremap ][ :call LatexBoxNextSection(1,0,1) vnoremap [] :call LatexBoxNextSection(1,1,1) vnoremap [[ :call LatexBoxNextSection(0,1,1) " }}} " vim:fdm=marker:ff=unix:noet:ts=4:sw=4 endif