ocaml.vim 2.0 KB

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