简体   繁体   中英

Ocaml - Emacs tuareg mode

I just started to use the tuareg mode in emacs for ocaml programming. So can someone tell me what are the main advantages of using it? Can someone suggest me any tutorial for that?

Tuareg-mode is good because it can parse code and calculate indentation & font-lock basing on this information. Plus it provides pretty good possibilities to interactive work with code.

Regarding tutorial - I don't think that such exists (although I planned to write it long time ago). All information for installation is in README file, and you can learn about available commands by visiting file with OCaml source code, and pressing Ch m to get description of mode, or by getting description of tuareg-mode function (if tuareg.el is loaded already).

Useful addition to these descriptions is Tuareg mode refcard that lists all (or almost) available commands.

Tuareg is really nice for:

  • Highlighting your code
  • Indenting your code correctly
  • Easily sending portions of code to a REPL
  • Easily compiling your code
  • Syntax highlight, indentation, as (almost) all language modes.
  • Compile or evaluate in a top level from a single buffer (you no longer need to open a ocaml toplevel in a command line to test some crap functions)
  • Caml-types minor mode : after a successful or partial compilation, you can easily point a variable and get the type the compiler inferred for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM