robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
c63e794b10
master
1" Vim compiler file 2" Compiler: ConTeXt typesetting engine 3" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> 4" Last Change: 2016 Oct 21 5 6if exists ( "current_compiler" ) 7finish 8endif 9let s: keepcpo = & cpo 10set cpo & vim 11 12" If makefile exists and we are not asked to ignore it, we use standard make 13" (do not redefine makeprg) 14if get ( b:, 'context_ignore_makefile' , get ( g:, 'context_ignore_makefile' , 0 )) || 15 \( ! filereadable ( 'Makefile' ) && ! filereadable ( 'makefile' )) 16let current_compiler = 'context' 17" The following assumes that the current working directory is set to the 18" directory of the file to be typeset 19let s: makeprg = get ( b:, 'context_mtxrun' , get ( g:, 'context_mtxrun' , 'mtxrun' )) 20 \. ' --script context --autogenerate --nonstopmode --synctex=' 21 \. ( get ( b:, 'context_synctex' , get ( g:, 'context_synctex' , 0 )) ? '1' : '0' ) 22 \. ' ' . get ( b:, 'context_extra_options' , get ( g:, 'context_extra_options' , '' )) 23 \. ' ' . shellescape ( expand ( '%:p:t' )) 24" CompilerSet makeprg=context 25execute 'CompilerSet makeprg=' .. escape ( s: makeprg , ' ' ) 26else 27let current_compiler = 'make' 28endif 29 30let b: context_errorformat = '' 31 \. '%-Popen source%.%#> %f,' 32 \. '%-Qclose source%.%#> %f,' 33 \. "%-Popen source%.%#name '%f'," 34 \. "%-Qclose source%.%#name '%f'," 35 \. '%Etex %trror%.%#mp error on line %l in file %f:%.%#,' 36 \. 'tex %trror%.%#error on line %l in file %f: %m,' 37 \. '%Elua %trror%.%#error on line %l in file %f:,' 38 \. '%+Emetapost %#> error: %#,' 39 \. '! error: %#%m,' 40 \. '%-C %#,' 41 \. '%C! %m,' 42 \. '%Z[ctxlua]%m,' 43 \. '%+C<*> %.%#,' 44 \. '%-C%.%#,' 45 \. '%Z...%m,' 46 \. '%-Zno-error,' 47 \. '%-G%.%#' " Skip remaining lines 48 49execute 'CompilerSet errorformat=' . escape ( b: context_errorformat , ' ' ) 50 51let & cpo = s: keepcpo 52unlet s: keepcpo