From ba1305772d6dc5939fd7fbad57108aa71ee2d158 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 17 Sep 2013 01:43:28 +0200 Subject: fix: Switch latex to LaTeX-Box-Team/LaTeX-Box, fixes #6 --- ftplugin/latex-box/mappings.vim | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 ftplugin/latex-box/mappings.vim (limited to 'ftplugin/latex-box/mappings.vim') diff --git a/ftplugin/latex-box/mappings.vim b/ftplugin/latex-box/mappings.vim new file mode 100644 index 00000000..509f5f19 --- /dev/null +++ b/ftplugin/latex-box/mappings.vim @@ -0,0 +1,96 @@ +" 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 -- cgit v1.2.3