Install Atom (obviously).
Assuming you are on a Debian/Ubuntu system install these system packages:
sudo apt-get install ocaml-core opam ocp-indent
Then install merlin and initialize it: (no sudo here)
opam install merlin
opam user-setup install
And finally within Atom either use the graphical package installer on the settings page and install the following packages:
- ocaml-merlin
- ocaml-indent
- language-ocaml
- repl
...or if you prefer to do this with one line on the shell, try:
apm install ocaml-merlin ocaml-indent language-ocaml repl
Syntax highlighting and linting should work out of the box. In order to run OCaml code right within Atom,
- open an OCaml file
- press CTRL+y CTRL+o to open an OCaml interpreter (like a live OCaml session)
- select the pieces of code you want to run with your mouse
- press CTRL+y CTRL+s to copy the selected pieces of code into the OCaml interpreter and run them.
- if you want to run the entire file you can press CTRL+y CTRL+f (only after opening the interpreter)
language-ocaml is broke. Is there any fix ?