Installation¶
MELPA¶
neocaml is available on MELPA. If you have
MELPA in your package-archives, install it with:
M-x package-install <RET> neocaml <RET>
Or with use-package:
(use-package neocaml
:ensure t)
From GitHub¶
You can install directly from the repository:
M-x package-vc-install <RET> https://github.com/bbatsov/neocaml <RET>
Or with use-package on Emacs 30+:
(use-package neocaml
:vc (:url "https://github.com/bbatsov/neocaml" :rev :newest))
Note
If the required tree-sitter grammars are not installed, run
M-x neocaml-install-grammars to install the OCaml and
OCaml-interface grammars. If grammar installation fails, see
Troubleshooting.
The modes for dune, opam, OCamllex, Menhir, and odoc files each
use their own grammar. Each mode offers to install its grammar the
first time you open a file of that type, or you can install them
with M-x neocaml-dune-install-grammar,
M-x neocaml-opam-install-grammar,
M-x neocaml-ocamllex-install-grammar,
M-x neocaml-menhir-install-grammar, and
M-x neocaml-odoc-install-grammar. neocaml-mlx-mode uses the OCaml
grammar, plus the tsx grammar to highlight the JSX in .mlx files,
which M-x neocaml-mlx-install-grammar installs.
Tip
If you have another OCaml major mode installed (e.g. tuareg or caml-mode),
consider removing it to avoid conflicts over .ml and .mli file
associations. See Migrating from tuareg / caml-mode
for details.
What's Next?¶
Head to Getting Started to see what works out of the box, set up Eglot, and learn the basic workflow. Then check Configuration to customize font-lock levels, indentation, and more.