diff --git a/autoload/vimtex.vim b/autoload/vimtex.vim index ea32752..c619e9d 100644 --- a/autoload/vimtex.vim +++ b/autoload/vimtex.vim @@ -608,7 +608,7 @@ function! s:get_main_recurse(file) " {{{1 let l:file_re = '\s*((.*)\/)?' . fnamemodify(a:file, ':t:r') let l:filter = 'v:val =~# ''\v' - let l:filter .= '\\%(input|include)\{' . l:file_re + let l:filter .= '\\%(input|include%(only)?)\{' . l:file_re let l:filter .= '|\\subimport\{[^\}]*\}\{' . l:file_re let l:filter .= '''' diff --git a/autoload/vimtex/complete.vim b/autoload/vimtex/complete.vim index 409f3cd..513183c 100644 --- a/autoload/vimtex/complete.vim +++ b/autoload/vimtex/complete.vim @@ -354,7 +354,7 @@ endfunction " {{{1 Filenames (\input and \include) let s:inc = { - \ 'pattern' : '\v\\%(include|input)\s*\{[^{}]*', + \ 'pattern' : '\v\\%(include%(only)?|input)\s*\{[^\{\}]*', \ 'enabled' : 1, \} diff --git a/autoload/vimtex/parser.vim b/autoload/vimtex/parser.vim index 3f1c1fa..66d014b 100644 --- a/autoload/vimtex/parser.vim +++ b/autoload/vimtex/parser.vim @@ -9,7 +9,7 @@ endfunction " }}}1 function! vimtex#parser#init_script() " {{{1 - let s:input_line_tex = '\v^\s*\\%(input|include|subimport|subfile)\s*\{' + let s:input_line_tex = '\v^\s*\\%(input|include%(only)?|subimport|subfile)\s*\{' let s:input_line_aux = '\\@input{' endfunction diff --git a/doc/vimtex.txt b/doc/vimtex.txt index f2a542c..c138dd2 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -1392,7 +1392,7 @@ documents with |neocomplete| and |vimtex|s omni completion function: > \ '\v\\%(' \ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*' \ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*' - \ . '|%(include|input)\s*\{[^{}]*' + \ . '|%(include%(only)?|input)\s*\{[^\{\}]*' \ . ')' < YouCompleteMe~ @@ -1418,7 +1418,7 @@ To enable automatic completion with |youcompleteme|, use the following options: let g:ycm_semantic_triggers.tex = [ \ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*,?)*', \ 're!\\includegraphics([^]]*])?{[^}]*', - \ 're!\\(include|input){[^}]*' + \ 're!\\(include(only)?|input)\{[^\{\}]*' \ ] ==============================================================================