" LaTeX Box mappings if exists("g:LatexBox_no_mappings") finish endif " latexmk {{{ map ll :Latexmk map lL :Latexmk! map lc :LatexmkClean map lC :LatexmkClean! map lg :LatexmkStatus map lG :LatexmkStatus! map lk :LatexmkStop map le :LatexErrors " }}} " View {{{ map lv :LatexView " }}} " TOC {{{ map lt :LatexTOC " }}} " 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 omap ie :normal vie omap ae :normal vae vmap i$ LatexBox_SelectInlineMathInner vmap a$ LatexBox_SelectInlineMathOuter omap i$ :normal vi$ omap 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