ocaml.vim 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. " Vim Compiler File
  2. " Compiler: ocaml
  3. " Maintainer: Markus Mottl <markus.mottl@gmail.com>
  4. " URL: https://github.com/ocaml/vim-ocaml
  5. " Last Change:
  6. " 2020 Mar 28 - Improved error format (Thomas Leonard)
  7. " 2017 Nov 26 - Improved error format (Markus Mottl)
  8. " 2013 Aug 27 - Added a new OCaml error format (Markus Mottl)
  9. "
  10. " Marc Weber's comments:
  11. " Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
  12. " ocamake and whatnot. So which one to use?
  13. "
  14. " This error format was moved from ftplugin/ocaml.vim to this file,
  15. " because ftplugin is the wrong file to set an error format
  16. " and the error format itself is annoying because it joins many lines in this
  17. " error case:
  18. "
  19. " Error: The implementation foo.ml does not match the interface foo.cmi:
  20. " Modules do not match case.
  21. "
  22. " So having it here makes people opt-in
  23. if exists("current_compiler")
  24. finish
  25. endif
  26. let current_compiler = "ocaml"
  27. let s:cpo_save = &cpo
  28. set cpo&vim
  29. CompilerSet errorformat =
  30. \%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
  31. \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
  32. \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
  33. \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
  34. \%+EReference\ to\ unbound\ regexp\ name\ %m,
  35. \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
  36. \%Wocamlyacc:\ w\ -\ %m,
  37. \%-Zmake%.%#,
  38. \%C%m,
  39. \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
  40. \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
  41. \%D%*\\a:\ Entering\ directory\ `%f',
  42. \%X%*\\a:\ Leaving\ directory\ `%f',
  43. \%D%*\\a[%*\\d]:\ Entering\ directory\ '%f',
  44. \%X%*\\a[%*\\d]:\ Leaving\ directory\ '%f',
  45. \%D%*\\a:\ Entering\ directory\ '%f',
  46. \%X%*\\a:\ Leaving\ directory\ '%f',
  47. \%DEntering\ directory\ '%f',
  48. \%XLeaving\ directory\ '%f',
  49. \%DMaking\ %*\\a\ in\ %f
  50. let &cpo = s:cpo_save
  51. unlet s:cpo_save