1
2
3
4
5
6
7
8UTOP(1) General Commands Manual UTOP(1)
9
10
11
13 utop - Universal toplevel for OCaml
14
15
17 utop [ options ] [ object-files ] [ script-file ]
18
19
21 utop is a enhanced toplevel for OCaml with many features, including
22 context sensitive completion.
23
24 When you start utop what you see is the prompt followed by a bar con‐
25 taining words. This is the completion bar, it contains the possible
26 completion and is updated as you type. The highlighted word in the com‐
27 pletion bar is the selected word. You can navigate using the keys
28 Alt+Left and Alt+Right and you can complete using the currently
29 selected word by pressing Alt+Tab (you can configure these bindings in
30 the file ~/.config/lambda-term-inputrc , see lambda-term-inputrc(5) for
31 details).
32
33 utop supports completion on:
34
35 * directives and directive arguments
36 * identifiers
37 * record fields
38 * variants
39 * function labels
40 * object methods
41
42 Colors are by default configured for terminals with dark colors, such
43 as white on black, so the prompt may looks too bright on light colors
44 terminals. You can change that by setting the color profile of utop.
45 For that type:
46
47 UTop.set_profile UTop.Light;;
48
49 You can then add this line to your ~/.config/utop/init.ml file.
50
51 To turn off utop's advanced prompt features, add the following to
52 init.ml to turn off respectively (a) colors and the upper information
53 line, and (b) the lower boxed list of possible completions:
54
55 #utop_prompt_dummy;;
56 UTop.set_show_box false
57
58 You can enable basic syntax highlighting in utop by writing a ~/.utoprc
59 file. See utoprc(5) for that.
60
61 Finally utop can run in emacs. For that you have to add the following
62 line to your ~/.emacs file:
63
64 (autoload 'utop "utop" "Toplevel for OCaml" t)
65
66 then you can run utop by pressing M-x and typing "utop". utop support
67 completion in emacs mode. Just press Tab to complete a word. You can
68 also integrate it with the tuareg, caml or typerex mode. For that add
69 the following lines to your ~/.emacs file:
70
71 (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
72 (add-hook 'tuareg-mode-hook 'utop-minor-mode)
73
74
76 Same as ocaml(1).
77
78
80 ~/.config/utop/init.ml
81 The initialization file of the toplevel.
82 ~/.ocamlinit
83 The alternative initialization file of the toplevel.
84 ~/.utoprc
85 The configuration file for utop. See utoprc(5).
86 ~/.config/lambda-term-inputrc
87 The file containing key bindings. See lambda-term-inputrc(5).
88
89
91 Jérémie Dimino <jeremie@dimino.org>
92
93
95 utoprc(5), lambda-term-inputrc(5), ocaml(1).
96
97
98
99 August 2011 UTOP(1)