summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-02-04 19:13:11 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2014-02-04 19:13:11 +0100
commitfa573209195e94d621f50bfe37cf9007f6e8d720 (patch)
tree1193f7849873686760ad28d64add167f41c69654 /ftplugin
parent9a2b4f5cd8bcb03f1344fa9f81b59efb84a91889 (diff)
downloadvim-polyglot-fa573209195e94d621f50bfe37cf9007f6e8d720.tar.gz
vim-polyglot-fa573209195e94d621f50bfe37cf9007f6e8d720.zip
Update
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/latex-box/common.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/ftplugin/latex-box/common.vim b/ftplugin/latex-box/common.vim
index 7df90020..e132e22b 100644
--- a/ftplugin/latex-box/common.vim
+++ b/ftplugin/latex-box/common.vim
@@ -106,13 +106,20 @@ function! LatexBox_GetMainTexFile()
return expand('%:p')
endif
- " 4 borrow the Vim-Latex-Suite method of finding it
+ " 4. use 'main.tex' if it exists in the same directory (and is readable)
+ let s:main_dot_tex_file=expand('%:p:h') . '/main.tex'
+ if filereadable(s:main_dot_tex_file)
+ let b:main_tex_file=s:main_dot_tex_file
+ return b:main_tex_file
+ endif
+
+ " 5. borrow the Vim-Latex-Suite method of finding it
if Tex_GetMainFileName() != expand('%:p')
let b:main_tex_file = Tex_GetMainFileName()
return b:main_tex_file
endif
- " 5. prompt for file with completion
+ " 6. prompt for file with completion
let b:main_tex_file = s:PromptForMainFile()
return b:main_tex_file
endfunction