Camlhighlight provides syntax highlighting facilities for OCaml applications.
opam install camlhighlight