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.

50 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. - `flycheck-ocaml`
  17. ## Environment Setup
  18. These setups for ocaml assume that you are using the OPAM package
  19. manager (http://opam.ocaml.org/).
  20. Because of the apparent complexity of getting Emacs environment
  21. variables setup to use opam correctly, it is instead easier to use
  22. opam itself to execute any necessary commands.
  23. Also, the standard OCaml toplevel usage has been replaced in favor
  24. of UTOP, the universal toplevel, and we assume that you are using
  25. the Jane Street Core libraries rather than the regular OCaml
  26. standard libraries
  27. The minimum required setup for using Prelude's OCaml setup would be
  28. to install OPAM, and then, minimally `opam install core utop'. A
  29. good getting started guide is available at
  30. https://dev.realworldocaml.org/install.html
  31. ## Configuration
  32. Prelude disables Merlin's own linting in favor of Flycheck. It also
  33. leverages Merlin's company-mode backend instead of using directly
  34. Merlin's rudimentary auto-completion system.