context.vim (1885B)
1 " Vim compiler file 2 " Compiler: ConTeXt typesetting engine 3 " Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com> 4 " Last Change: 2016 Oct 21 5 6 if exists("current_compiler") 7 finish 8 endif 9 let s:keepcpo= &cpo 10 set cpo&vim 11 12 " If makefile exists and we are not asked to ignore it, we use standard make 13 " (do not redefine makeprg) 14 if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || 15 \ (!filereadable('Makefile') && !filereadable('makefile')) 16 let current_compiler = 'context' 17 " The following assumes that the current working directory is set to the 18 " directory of the file to be typeset 19 let 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 25 execute 'CompilerSet makeprg=' .. escape(s:makeprg, ' ') 26 else 27 let current_compiler = 'make' 28 endif 29 30 let 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 49 execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ') 50 51 let &cpo = s:keepcpo 52 unlet s:keepcpo