Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB

  1. # Prelude OCaml
  2. !!! Note
  3. This module builds on top of the shared [Programming](programming.md) module.
  4. ## Overview
  5. Prelude provides powerful out-of-the-box experience for programming in OCaml:
  6. - major-mode for editing OCaml code (`tuareg-mode`)
  7. - integration with `utop`, OCaml's modern top-level (you can think of it as a REPL)
  8. - linting via `flycheck` or `merlin`
  9. - code completion via `merlin`
  10. You can get similar experience using OCaml's LSP server, but it's based on Merlin internally and the setup with LSP is a bit more involved.
  11. ## Packages
  12. When the `prelude-ocaml` is enabled it will install 3 packages:
  13. - `tuareg-mode`
  14. - `utop`
  15. - `merlin`
  16. ## Environment Setup
  17. These setups for ocaml assume that you are using the OPAM package
  18. manager (http://opam.ocaml.org/).
  19. Because of the apparent complexity of getting Emacs environment
  20. variables setup to use opam correctly, it is instead easier to use
  21. opam itself to execute any necessary commands.
  22. Also, the standard OCaml toplevel usage has been replaced in favor
  23. of UTOP, the universal toplevel, and we assume that you are using
  24. the Jane Street Core libraries rather than the regular OCaml
  25. standard libraries
  26. The minimum required setup for using Prelude's OCaml setup would be
  27. to install OPAM, and then, minimally `opam install core utop'. A
  28. good getting started guide is available at
  29. https://dev.realworldocaml.org/install.html
  30. ## Configuration
  31. Prelude disables Merlin's own linting in favor of Flycheck. It also
  32. leverages Merlin's company-mode backend instead of using directly
  33. Merlin's rudimentary auto-completion system.