blob: 282b3a0588e9eac7fa502664b90c8a8a04be8dd0 [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>
Enno18d730d2024-03-31 18:37:05 +02004" Contributors: Enno Nagel
5" Last Change: 2024 Mar 29
Doug Kearns408281e2024-04-04 22:00:58 +02006" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
zeertzjqb73faa12024-04-06 02:01:16 +08007" 2024 Apr 05 by The Vim Project (avoid leaving behind g:makeprg)
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9if exists("current_compiler")
10 finish
11endif
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020012let s:keepcpo= &cpo
13set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
Bram Moolenaar071d4272004-06-13 20:20:40 +000015" If makefile exists and we are not asked to ignore it, we use standard make
16" (do not redefine makeprg)
17if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
18 \(!filereadable('Makefile') && !filereadable('makefile'))
19 " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
Bram Moolenaar6c391a72021-09-09 21:55:11 +020020 " otherwise the same for global variable with same name, else it will be
Bram Moolenaar071d4272004-06-13 20:20:40 +000021 " LaTeX
22 if exists("b:tex_flavor")
23 let current_compiler = b:tex_flavor
24 elseif exists("g:tex_flavor")
25 let current_compiler = g:tex_flavor
26 else
27 let current_compiler = "latex"
28 endif
zeertzjqb73faa12024-04-06 02:01:16 +080029 let s:makeprg=current_compiler .. ' -interaction=nonstopmode'
30 execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ')
Bram Moolenaar071d4272004-06-13 20:20:40 +000031else
32 let current_compiler = 'make'
33endif
34
Bram Moolenaar071d4272004-06-13 20:20:40 +000035" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
36" addition from Srinath Avadhanula <srinath@fastmail.fm>
37CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
38 \%E!\ %m,
39 \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
40 \%+W%.%#\ at\ lines\ %l--%*\\d,
41 \%WLaTeX\ %.%#Warning:\ %m,
42 \%Cl.%l\ %m,
43 \%+C\ \ %m.,
44 \%+C%.%#-%.%#,
45 \%+C%.%#[]%.%#,
46 \%+C[]%.%#,
47 \%+C%.%#%[{}\\]%.%#,
48 \%+C<%.%#>%.%#,
49 \%C\ \ %m,
50 \%-GSee\ the\ LaTeX%m,
51 \%-GType\ \ H\ <return>%m,
52 \%-G\ ...%.%#,
53 \%-G%.%#\ (C)\ %.%#,
54 \%-G(see\ the\ transcript%.%#),
55 \%-G\\s%#,
56 \%+O(%*[^()])%r,
57 \%+O%*[^()](%*[^()])%r,
58 \%+P(%f%r,
59 \%+P\ %\\=(%f%r,
60 \%+P%*[^()](%f%r,
61 \%+P[%\\d%[^()]%#(%f%r,
62 \%+Q)%r,
63 \%+Q%*[^()])%r,
64 \%+Q[%\\d%*[^()])%r
65
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020066let &cpo = s:keepcpo
67unlet s:keepcpo