Add buffer var for main file (fixes #155)
This commit is contained in:
parent
710c6f3d7a
commit
3f62338895
@ -168,6 +168,13 @@ function! s:get_id(main) " {{{1
|
||||
endfunction
|
||||
|
||||
function! s:get_main() " {{{1
|
||||
"
|
||||
" Use buffer variable if it exists
|
||||
"
|
||||
if exists('b:vimtex_main') && filereadable(b:vimtex_main)
|
||||
return fnamemodify(b:vimtex_main, ':p')
|
||||
endif
|
||||
|
||||
"
|
||||
" Search for main file specifier at the beginning of file. This is similar
|
||||
" to the method used by several other plugins and editors, such as vim with
|
||||
|
@ -150,6 +150,13 @@ first five lines of the current file similar to this: >
|
||||
|
||||
%! TEX root = my-main.tex
|
||||
|
||||
< *b:vimtex_main*
|
||||
Finally, the main file may be specified through the buffer variable
|
||||
`b:vimtex_main`. If one uses project specific |vimrc| files, one may then use
|
||||
an |autocmd| to specify the main file through this buffer variable with >
|
||||
|
||||
autocmd FileType tex let b:vimtex_main = 'main.tex'
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Comment on internal tex plugin~
|
||||
*vimtex-comment-internal*
|
||||
|
Loading…
Reference in New Issue
Block a user