spacemacs/contrib/lang/ocaml
2015-05-12 20:17:10 -04:00
..
img Add ocaml layer 2015-02-07 23:29:08 -05:00
config.el ocaml: auto-complete with merlin and company mode 2015-05-11 20:38:01 -04:00
funcs.el ocaml: refactor layer to make it better for spacemacs idioms 2015-05-11 23:45:26 -04:00
packages.el Fix typos in ocaml layer. 2015-05-12 20:17:10 -04:00
README.md ocaml: refactor layer to make it better for spacemacs idioms 2015-05-11 23:45:26 -04:00

Ocaml contribution layer for Spacemacs

logo

Table of Contents

Description

This is a very basic layer for editing ocaml files.

  • Syntax highlighting (major-mode) via tuareg-mode
  • Error reporting, completion and type display via merlin
  • auto-completion with company mode via merlin
  • syntax-checking via flycheck-ocaml

Install

Layer

To use this contribution add it to your ~/.spacemacs

(setq-default dotspacemacs-configuration-layers '(ocaml))

OPAM packages

This layer requires some opam packages:

  • merlin for auto-completion
  • utop
  • ocp-indent

To install them, use the following command:

opam install merlin utop ocp-indent

Key Bindings

Key Binding       |                 Description

----------------------|-------------------------------------------------------- SPC m c c | Compile SPC m e t | Highlight identifier under cursor and print its type

REPL (utop)

Key Binding       |                 Description

----------------------|-------------------------------------------------------- SPC m s b | Send buffer to the REPL SPC m s B | Send buffer to the REPL and switch to the REPL in insert state SPC m s i | Start a REPL SPC m s p | Send phrase to the REPL SPC m s P | Send phrase to the REPL and switch to the REPL in insert state SPC m s r | Send region to the REPL SPC m s R | Send region to the REPL and switch to the REPL in insert state C-j | (in REPL) next item in history C-k | (in REPL) previous item in history

TODO

  • Add more proper spacemacs key-bindings for basic merlin tasks
  • Add proper keybindings for ocamldebug
  • Add more keybindings for tuareg-mode