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.
|
|
# Prelude OCaml
!!! Note
This module builds on top of the shared [Programming](programming.md) module.
## Overview
Prelude provides powerful out-of-the-box experience for programming in OCaml:
- major-mode for editing OCaml code (`tuareg-mode`)- integration with `utop`, OCaml's modern top-level (you can think of it as a REPL)- linting via `flycheck` or `merlin`- code completion via `merlin`
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.
## Packages
When the `prelude-ocaml` is enabled it will install 3 packages:
- `tuareg-mode`- `utop`- `merlin`- `flycheck-ocaml`
## Environment Setup
These setups for ocaml assume that you are using the OPAM packagemanager (http://opam.ocaml.org/).
Because of the apparent complexity of getting Emacs environmentvariables setup to use opam correctly, it is instead easier to useopam itself to execute any necessary commands.
Also, the standard OCaml toplevel usage has been replaced in favorof UTOP, the universal toplevel, and we assume that you are usingthe Jane Street Core libraries rather than the regular OCamlstandard libraries
The minimum required setup for using Prelude's OCaml setup would beto install OPAM, and then, minimally `opam install core utop'. Agood getting started guide is available athttps://dev.realworldocaml.org/install.html
## Configuration
Prelude disables Merlin's own linting in favor of Flycheck. It alsoleverages Merlin's company-mode backend instead of using directlyMerlin's rudimentary auto-completion system.
|