2

I use the following script to start the toplevel:

breakchars="(){}[],^%$#@\"\";:''\\"
exec rlwrap --remember -c -b "$breakchars"  -f "$HOME"/.ml_completions -S '> ' ocaml -init ~/.ocamlinit "$@"

Then how can I build the .ml_completions file so that I can auto-complete input in the toplevel?

Flux
  • 9,805
  • 5
  • 46
  • 92
z_axis
  • 8,272
  • 7
  • 41
  • 61

1 Answers1

2

I'm not sure how to create a completion file for rlwrap, but you can use utop as an alternative:

https://github.com/ocaml-community/utop

It supports line editing, context-sensitive completion and syntax highlighting in the toplevel.

Flux
  • 9,805
  • 5
  • 46
  • 92
hcarty
  • 1,671
  • 8
  • 8