Skip to content
Cheng Lou edited this page Feb 5, 2016 · 6 revisions

Atom for OCaml

Atom, made by the GitHub company, is a fast-growing and promising text editor with IDE features and increasing support for OCaml. One of its interesting features is that it can mimic vi, in a more convenient and modern GUI. It can also easily integrate the OCamlMakefile-based build process.

Installing Atom

Download and install the atom*.deb file (or whatever OS you use). from atom.io first.

Install the nuclide package to get ocamlmerlin integration. For the installation process, you can use the GUI (settings (Ctrl+,) -> install) or the local CLI package manager:

apm install nuclide

Currently Nuclide is going through a package reorganization phase, so its setting page is a bit messy. For your OCaml purpose, feel free to disable everything except Enable the "nuclide-ocaml" feature toward the bottom. You might also need to manually specify the ocamlmerlin path near the middle: nuclide-ocaml: Path to Merlin Executable.

Other useful packages recommended: language-ocaml (highly recommended), minimal, minimal-bookmarks, minimal-selection, minimap-cursorline, hyperclick (comes with Nuclide), vim-mode (or the alternative vim-mode-plus), ex-mode, build, build-make

Benefit

The Nuclide Merlin integration is still under active development. Currently, it provides autocompletion.

Now when you type e.g. "List.m" it will show a dynamic dropdown with appropriate Pervasives functions along with their types, below the list of snippets given by the language-ocaml package, if you've installed it.

For more advanced Merlin settings, such as seeing the other modules and provide their autocompletes inside your current module's file, use the conventional .merlin file at the root of your project.