Skip to content

Latest commit

 

History

History
114 lines (96 loc) · 5.47 KB

README.org

File metadata and controls

114 lines (96 loc) · 5.47 KB

:lang ocaml

Description

This module adds OCaml support to Doom Emacs, powered by tuareg-mode.

  • Code completion, documentation look-up, code navigation and refactoring (merlin)
  • Type, documentation and function argument display on idle (merlin-eldoc)
  • REPL (utop)
  • Syntax-checking (merlin with flycheck-ocaml)
  • Auto-indentation (ocp-indent)
  • Code formatting (ocamlformat)
  • Dune file format (dune)

Maintainers

This module needs a maintainer. Become a maintainer?

Module flags

+lsp
Enable LSP support for tuareg-mode. Requires :tools lsp and a langserver (supports ocaml-language-server).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires :tools tree-sitter.

Packages

  • dune
  • ocamlformat if :editor format
  • ocp-indent
  • tuareg
  • utop if :tools eval
  • unless +lsp
    • flycheck-ocaml if :checkers syntax
    • merlin
    • merlin-company
    • merlin-eldoc

Hacks

  • set-ligatures! is called with the full tuareg prettify symbol list, this can cause columns to change as certain keywords are shortened (e.g. fun becomes λ).
  • tuareg-opam-update-env is called the first time tuareg is loaded

Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module requires the following packages available through opam:

  • merlin
  • utop
  • ocp-indent
  • dune
  • ocamlformat

Usage

🔨 This module’s usage documentation is incomplete. Complete it?

  • The following files should have syntax highlighting support: .ml{i,p,y,}, .eliom{i,}, jbuild, dune, opam
  • merlin-mode is activated whenever a .merlin file is found (including in a parent directory) and ocamlmerlin executable is present
  • Line-based auto-indentation is provided by ocp-indent, if it is available.
CommandKeyDescription
merlin-type-enclosing<localleader> tdisplay type under point
tuareg-find-alternate-file<localleader> aswitch between .ml and .mli
merlin-locateg dlookup definition
merlin-occurencesSPC c Dlookup references
merlin-documentKlookup documentation
merlin-imenuSPC s isymbol lookup in file
merlin-iedit-occurrencesv Rvisual refactor identifier under point (multiple cursors)
utopSPC o ropen utop as REPL
utop-eval-regionSPC c eevaluate selected region in utop

Configuration

🔨 This module’s configuration documentation is incomplete. Complete it?

  • If :completion company is enabled then autocomplete is provided by merlin
  • When :checkers syntax is enabled then flycheck-ocaml is activated to do on-the-fly syntax/type checking via merlin, otherwise this is only done when the file is saved.
  • Spell checking is activated in comments if :checkers spell is active
  • A REPL is provided if utop is installed and :tools eval is active
  • If :editor format is enabled, the ocamlformat executable is available and there is an .ocamlformat file present then format-all-buffer is bound to ocamlformat, otherwise to ocp-indent
  • If :editor multiple-cursors is enabled then identifiers can be refactored with v R and multiple cursors (this correctly matches identifier occurrences according to scope, it is not purely a textual match)

Run $ doom sync to install all packages and $ doom doctor to diagnose missing tools.

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

Appendix

🔨 This module has no appendix yet. Write one?