blob: 9d8c66056c347dcc6fe1b6be14186c1fcd35babc [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)
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
8if exists("current_compiler")
9 finish
10endif
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020011let s:keepcpo= &cpo
12set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000013
Bram Moolenaar071d4272004-06-13 20:20:40 +000014" 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,
Bram Moolenaar6c391a72021-09-09 21:55:11 +020019 " otherwise the same for global variable with same name, else it will be
Bram Moolenaar071d4272004-06-13 20:20:40 +000020 " 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
Enno18d730d2024-03-31 18:37:05 +020028 let makeprg=current_compiler .. ' -interaction=nonstopmode'
29 execute 'CompilerSet makeprg=' .. escape(makeprg, ' ')
Bram Moolenaar071d4272004-06-13 20:20:40 +000030else
31 let current_compiler = 'make'
32endif
33
Bram Moolenaar071d4272004-06-13 20:20:40 +000034" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
35" addition from Srinath Avadhanula <srinath@fastmail.fm>
36CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
37 \%E!\ %m,
38 \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
39 \%+W%.%#\ at\ lines\ %l--%*\\d,
40 \%WLaTeX\ %.%#Warning:\ %m,
41 \%Cl.%l\ %m,
42 \%+C\ \ %m.,
43 \%+C%.%#-%.%#,
44 \%+C%.%#[]%.%#,
45 \%+C[]%.%#,
46 \%+C%.%#%[{}\\]%.%#,
47 \%+C<%.%#>%.%#,
48 \%C\ \ %m,
49 \%-GSee\ the\ LaTeX%m,
50 \%-GType\ \ H\ <return>%m,
51 \%-G\ ...%.%#,
52 \%-G%.%#\ (C)\ %.%#,
53 \%-G(see\ the\ transcript%.%#),
54 \%-G\\s%#,
55 \%+O(%*[^()])%r,
56 \%+O%*[^()](%*[^()])%r,
57 \%+P(%f%r,
58 \%+P\ %\\=(%f%r,
59 \%+P%*[^()](%f%r,
60 \%+P[%\\d%[^()]%#(%f%r,
61 \%+Q)%r,
62 \%+Q%*[^()])%r,
63 \%+Q[%\\d%*[^()])%r
64
Bram Moolenaar9a7224b2012-04-30 15:56:52 +020065let &cpo = s:keepcpo
66unlet s:keepcpo