Skip to content

Latest commit

 

History

History
101 lines (84 loc) · 4.64 KB

README.org

File metadata and controls

101 lines (84 loc) · 4.64 KB

Ocaml layer

img/ocaml.png

Table of Contents

Description

This is a very basic layer for editing ocaml files.

Features:

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add ocaml to the existing dotspacemacs-configuration-layers list in this file.

Using merlin for error reporting

By default flycheck-ocaml is used for error reporting when the syntax-checking layer is also enabled as this is common throughout spacemacs. You can disable this and switch back to merlin’s default error reporting method by adding flycheck-ocaml to your excluded packages list in .spacemacs:

dotspacemacs-excluded-packages '(... flycheck-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

Make sure opam is initialized and configured.

opam init
opam config setup -a

Key bindings

Key bindingDescription
SPC m =Indent buffer.
SPC m c cCompile
SPC m c pCheck .merlin for errors
SPC m c rRefresh changed .cmis in merlin
SPC m e CCheck for errors in current buffer
SPC m e nJump to next error
SPC m e NJump back to previous error
SPC m g aSwitch ML <-> MLI
SPC m g bGo back to the last position where the user did a locate
SPC m g gLocate the identifier under point (same window)
SPC m g GLocate the identifier under point (different window)
SPC m g oList occurrences for identifier under point
SPC m g lPrompt for identifier and locate
SPC m g iPrompt for module name and switch to ML file
SPC m g IPrompt for module name and switch to MLI file
SPC m h hDocument the identifier under point
SPC m h tHighlight identifier under cursor and print its type
SPC m h TPrompt for expression and show its type
SPC m r dCase analyze the current enclosing

REPL (utop)

Key bindingDescription
SPC m s bSend buffer to the REPL
SPC m s BSend buffer to the REPL and switch to the REPL in insert state
SPC m s iStart a REPL
SPC m s pSend phrase to the REPL
SPC m s PSend phrase to the REPL and switch to the REPL in insert state
SPC m s rSend region to the REPL
SPC m s RSend 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

layer improvements list

  1. Add more proper spacemacs key bindings for basic merlin tasks
  2. Add proper key bindings for ocamldebug
  3. Add more key bindings for tuareg-mode