context.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. vim9script
  2. # Language: ConTeXt typesetting engine
  3. # Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
  4. # Former Maintainers: Nikolai Weibull <now@bitwi.se>
  5. # Latest Revision: 2022 Aug 12
  6. if exists("g:current_compiler")
  7. finish
  8. endif
  9. import autoload '../autoload/context.vim'
  10. if exists(":CompilerSet") != 2 # Older Vim always used :setlocal
  11. command -nargs=* CompilerSet setlocal <args>
  12. endif
  13. g:current_compiler = 'context'
  14. if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) ||
  15. (!filereadable('Makefile') && !filereadable('makefile'))
  16. &l:makeprg = join(context.ConTeXtCmd(shellescape(expand('%:p:t'))), ' ')
  17. else
  18. g:current_compiler = 'make'
  19. endif
  20. const context_errorformat = join([
  21. "%-Popen source%.%#> %f",
  22. "%-Qclose source%.%#> %f",
  23. "%-Popen source%.%#name '%f'",
  24. "%-Qclose source%.%#name '%f'",
  25. "tex %trror%.%#error on line %l in file %f: %m",
  26. "%Elua %trror%.%#error on line %l in file %f:",
  27. "%+Emetapost %#> error: %#",
  28. "%Emetafun%.%#error: %m",
  29. "! error: %#%m",
  30. "%-C %#",
  31. "%C! %m",
  32. "%Z[ctxlua]%m",
  33. "%+C<*> %.%#",
  34. "%-C%.%#",
  35. "%Z...%m",
  36. "%-Zno-error",
  37. "%-G%.%#"], ",")
  38. execute 'CompilerSet errorformat=' .. escape(context_errorformat, ' ')
  39. # vim: sw=2 fdm=marker