blob: 5828a91ab91c66820d91969906ba9e9f972d9ac5 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim compiler file
2" Compiler: TeX
3" Maintainer: Artem Chuprina <ran@ran.pp.ru>
4" Last Change: 2004 Mar 27
5
6if exists("current_compiler")
7 finish
8endif
9
10if exists(":CompilerSet") != 2 " older Vim always used :setlocal
11 command -nargs=* CompilerSet setlocal <args>
12endif
13
14" If makefile exists and we are not asked to ignore it, we use standard make
15" (do not redefine makeprg)
16if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
17 \(!filereadable('Makefile') && !filereadable('makefile'))
18 " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
19 " otherwize the same for global variable with same name, else it will be
20 " LaTeX
21 if exists("b:tex_flavor")
22 let current_compiler = b:tex_flavor
23 elseif exists("g:tex_flavor")
24 let current_compiler = g:tex_flavor
25 else
26 let current_compiler = "latex"
27 endif
28 let &l:makeprg=current_compiler.' -interaction=nonstopmode'
29else
30 let current_compiler = 'make'
31endif
32
33let s:cpo_save = &cpo
34set cpo-=C
35
36" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
37" addition from Srinath Avadhanula <srinath@fastmail.fm>
38CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
39 \%E!\ %m,
40 \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
41 \%+W%.%#\ at\ lines\ %l--%*\\d,
42 \%WLaTeX\ %.%#Warning:\ %m,
43 \%Cl.%l\ %m,
44 \%+C\ \ %m.,
45 \%+C%.%#-%.%#,
46 \%+C%.%#[]%.%#,
47 \%+C[]%.%#,
48 \%+C%.%#%[{}\\]%.%#,
49 \%+C<%.%#>%.%#,
50 \%C\ \ %m,
51 \%-GSee\ the\ LaTeX%m,
52 \%-GType\ \ H\ <return>%m,
53 \%-G\ ...%.%#,
54 \%-G%.%#\ (C)\ %.%#,
55 \%-G(see\ the\ transcript%.%#),
56 \%-G\\s%#,
57 \%+O(%*[^()])%r,
58 \%+O%*[^()](%*[^()])%r,
59 \%+P(%f%r,
60 \%+P\ %\\=(%f%r,
61 \%+P%*[^()](%f%r,
62 \%+P[%\\d%[^()]%#(%f%r,
63 \%+Q)%r,
64 \%+Q%*[^()])%r,
65 \%+Q[%\\d%*[^()])%r
66
67let &cpo = s:cpo_save
68unlet s:cpo_save