ocaml.vim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " Vim Compiler File
  2. " Compiler: ocaml
  3. " Maintainer: See ftplugin/ocaml.vim (?)
  4. " Last Change: June 2013 by Marc Weber
  5. "
  6. " Marc Weber's comments:
  7. " Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
  8. " ocamake and whatnot. So which one to use?
  9. "
  10. " This error format was moved from ftplugin/ocaml.vim to this file,
  11. " because ftplugin is the wrong file to set an error format
  12. " and the error format itself is annoying because it joins many lines in this
  13. " error case:
  14. "
  15. " Error: The implementation foo.ml does not match the interface foo.cmi:
  16. " Modules do not match case.
  17. "
  18. " So having it here makes people opt-in
  19. if exists("current_compiler")
  20. finish
  21. endif
  22. let current_compiler = "ocaml"
  23. let s:cpo_save = &cpo
  24. set cpo&vim
  25. CompilerSet errorformat =
  26. \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
  27. \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
  28. \%+EReference\ to\ unbound\ regexp\ name\ %m,
  29. \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
  30. \%Wocamlyacc:\ w\ -\ %m,
  31. \%-Zmake%.%#,
  32. \%C%m,
  33. \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
  34. \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
  35. \%D%*\\a:\ Entering\ directory\ `%f',
  36. \%X%*\\a:\ Leaving\ directory\ `%f',
  37. \%DMaking\ %*\\a\ in\ %f
  38. let &cpo = s:cpo_save
  39. unlet s:cpo_save