blob: bc1623729ab1dbab400e5ed8e251244f71caf731 [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
Konfekt4927dae2024-11-19 22:41:14 +01006" 2024 Apr 03 by the Vim Project (removed :CompilerSet definition)
7" 2024 Apr 05 by the Vim Project (avoid leaving behind g:makeprg)
8" 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10if exists("current_compiler")
11 finish
12endif
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020013let s:keepcpo= &cpo
14set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000015
Bram Moolenaar071d4272004-06-13 20:20:40 +000016" If makefile exists and we are not asked to ignore it, we use standard make
17" (do not redefine makeprg)
18if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
19 \(!filereadable('Makefile') && !filereadable('makefile'))
20 " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
Bram Moolenaar6c391a72021-09-09 21:55:11 +020021 " otherwise the same for global variable with same name, else it will be
Bram Moolenaar071d4272004-06-13 20:20:40 +000022 " LaTeX
23 if exists("b:tex_flavor")
24 let current_compiler = b:tex_flavor
25 elseif exists("g:tex_flavor")
26 let current_compiler = g:tex_flavor
27 else
28 let current_compiler = "latex"
29 endif
zeertzjqb73faa12024-04-06 02:01:16 +080030 let s:makeprg=current_compiler .. ' -interaction=nonstopmode'
Konfekt4927dae2024-11-19 22:41:14 +010031 execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' \|"')
Bram Moolenaar071d4272004-06-13 20:20:40 +000032else
33 let current_compiler = 'make'
34endif
35
Bram Moolenaar071d4272004-06-13 20:20:40 +000036" 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
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020067let &cpo = s:keepcpo
68unlet s:keepcpo