summaryrefslogtreecommitdiffstats
path: root/ftplugin/latex-box
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin/latex-box')
-rw-r--r--ftplugin/latex-box/complete.vim1
-rw-r--r--ftplugin/latex-box/folding.vim39
-rw-r--r--ftplugin/latex-box/latexmk.vim7
3 files changed, 29 insertions, 18 deletions
diff --git a/ftplugin/latex-box/complete.vim b/ftplugin/latex-box/complete.vim
index 458e8d81..150b00e7 100644
--- a/ftplugin/latex-box/complete.vim
+++ b/ftplugin/latex-box/complete.vim
@@ -367,6 +367,7 @@ function! s:ExtractLabels()
" Ignore cref entries (because they are duplicates)
if curname =~# "@cref$"
+ let [lblline, lblbegin] = searchpos( '\\newlabel{', 'ecW' )
continue
endif
diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim
index 4fe13bc8..5d733c23 100644
--- a/ftplugin/latex-box/folding.vim
+++ b/ftplugin/latex-box/folding.vim
@@ -156,7 +156,7 @@ let s:notcomment = '\%(\%(\\\@<!\%(\\\\\)*\)\@<=%.*\)\@<!'
let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}'
let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}'
let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)'
-let s:folded = '\(% Fake\|\\\(document\|begin\|end\|'
+let s:folded = '\(% Fake\|\\\(document\|begin\|end\|paragraph\|'
\ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)'
function! LatexBox_FoldLevel(lnum)
@@ -193,26 +193,31 @@ function! LatexBox_FoldLevel(lnum)
endif
" Fold environments
- if line =~# s:envbeginpattern
- if g:LatexBox_fold_envs == 1
- return "a1"
- else
- let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}')
- if index(g:LatexBox_fold_envs_force, env) >= 0
+ if line =~# s:envbeginpattern && line =~# s:envendpattern
+ " If the begin and end pattern are on the same line , do not fold
+ return "="
+ else
+ if line =~# s:envbeginpattern
+ if g:LatexBox_fold_envs == 1
return "a1"
else
- return "="
+ let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}')
+ if index(g:LatexBox_fold_envs_force, env) >= 0
+ return "a1"
+ else
+ return "="
+ endif
endif
- endif
- elseif line =~# s:envendpattern
- if g:LatexBox_fold_envs == 1
- return "s1"
- else
- let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}')
- if index(g:LatexBox_fold_envs_force, env) >= 0
+ elseif line =~# s:envendpattern
+ if g:LatexBox_fold_envs == 1
return "s1"
else
- return "="
+ let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}')
+ if index(g:LatexBox_fold_envs_force, env) >= 0
+ return "s1"
+ else
+ return "="
+ endif
endif
endif
endif
@@ -288,7 +293,7 @@ function! LatexBox_FoldText_title()
endif
" Parts, sections and fakesections
- let sections = '\(\(sub\)*section\|part\|chapter\)'
+ let sections = '\(\(sub\)*\(section\|paragraph\)\|part\|chapter\)'
let secpat1 = '^\s*\\' . sections . '\*\?\s*{'
let secpat2 = '^\s*\\' . sections . '\*\?\s*\['
if line =~ '\\frontmatter'
diff --git a/ftplugin/latex-box/latexmk.vim b/ftplugin/latex-box/latexmk.vim
index bb70f83d..6c5d3eb1 100644
--- a/ftplugin/latex-box/latexmk.vim
+++ b/ftplugin/latex-box/latexmk.vim
@@ -23,6 +23,9 @@ endif
if ! exists('g:LatexBox_quickfix')
let g:LatexBox_quickfix = 1
endif
+if ! exists('g:LatexBox_personal_latexmkrc')
+ let g:LatexBox_personal_latexmkrc = 0
+endif
" }}}
@@ -177,7 +180,9 @@ function! LatexBox_Latexmk(force)
let cmd = 'cd ' . texroot . ' && '
endif
let cmd .= env . ' latexmk'
- let cmd .= ' -' . g:LatexBox_output_type
+ if ! g:LatexBox_personal_latexmkrc
+ let cmd .= ' -' . g:LatexBox_output_type
+ endif
let cmd .= ' -quiet '
let cmd .= g:LatexBox_latexmk_options
if a:force