Bring utop(1) man page up to date with README (#462)

* Fixed some minor typos in the README and man pages

* Adapted utop(1) man page to closer follow the README

* Fixed changes to dates
This commit is contained in:
G-J 2023-09-11 14:38:13 +02:00 committed by GitHub
parent 3e45a6e98f
commit fcb7903603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 16 deletions

View File

@ -118,7 +118,7 @@ Integration with Emacs
`utop.el` is a package that provides `utop` integration with Emacs. `utop.el` is a package that provides `utop` integration with Emacs.
The package allows you to run `utop` inside Emacs and to evaluate The package allows you to run `utop` inside Emacs and to evaluate
code in it straight from your source buffers (with the help with `utop-minor-mode`). code in it straight from your source buffers (with the help of `utop-minor-mode`).
Those features are covered in more details in the ["Usage"](#usage-emacs) section. Those features are covered in more details in the ["Usage"](#usage-emacs) section.

View File

@ -5,7 +5,7 @@
\" \"
\" This file is a part of utop. \" This file is a part of utop.
.TH UTOP 1 "August 2011" .TH UTOP 1
.SH NAME .SH NAME
utop \- Universal toplevel for OCaml utop \- Universal toplevel for OCaml
@ -33,15 +33,15 @@ When you start
what you see is the prompt followed by a bar containing words. This is what you see is the prompt followed by a bar containing words. This is
the completion bar: it contains the possible completion and is updated the completion bar: it contains the possible completion and is updated
as you type. The highlighted word in the completion bar is the as you type. The highlighted word in the completion bar is the
selected word. You can navigate using the keys Alt+Left and Alt+Right selected word. You can navigate using the keys \fBM-Left\fR and \fBM-Right\fR
and you can complete using the currently selected word by pressing and select one completion using \fBM-down\fR. Here \fBM\fR represents the meta key,
Alt+Tab (you can configure these bindings in the file which is \fBAlt\fR on most systems. You can configure these bindings in the file
.I ~/.config/lambda-term-inputrc .I ~/.config/lambda-term-inputrc
, see - see
.BR lambda-term-inputrc (5) .BR lambda-term-inputrc (5)
for details). for details.
utop supports completion on: \fButop\fR supports completion on:
* directives and directive arguments * directives and directive arguments
* identifiers * identifiers
@ -61,7 +61,7 @@ You can then add this line to your
.I ~/.config/utop/init.ml .I ~/.config/utop/init.ml
file. file.
To turn off utop's advanced prompt features, add the following to init.ml To turn off \fButop\fR's advanced prompt features, add the following to \fIinit.ml\fR
to turn off respectively (a) colors and the upper information line, and to turn off respectively (a) colors and the upper information line, and
(b) the lower boxed list of possible completions: (b) the lower boxed list of possible completions:
@ -74,14 +74,39 @@ file. See
.BR utoprc (5) .BR utoprc (5)
for that. for that.
Finally utop can run in emacs. For that you have to add the following line to your Vi edit mode is enabled by the command
.I ~/.emacs
file:
(autoload 'utop "utop" "Toplevel for OCaml" t) #edit_mode_vi
then you can run utop by pressing M-x and typing "utop". utop supports It currently supports three vi modes: normal, insert, visual mode, and you can
completion in emacs mode. Just press Tab to complete a word. You can get/set content with vim-like registers.
.I utop.el
is a package that provides
.B utop
integration with Emacs. The package allows you to run
.B utop
inside Emacs and to evaluate code in it straight from your source buffers
(with the help of \fIutop-minor-mode\fR).
The recommended way to install
.I utop.el
is via Emacs's built-in package manager \fBpackage.el\fR.
More detailed installation and configuration instructions may be found
on the project's code repository at \fIhttps://github.com/ocaml-community/utop\fR.
You can start \fButop\fR inside Emacs with \fBM-x utop\fR.
The default install also has a minor mode with the following key bindings:
\fBC-c C-s\fR Start a utop buffer (\fIutop\fR)
\fBC-x C-e\fR Evaluate the current phrase (\fIutop-eval-phrase\fR)
\fBC-x C-r\fR Evaluate the selected region (\fIutop-eval-region\fR)
\fBC-c C-b\fR Evaluate the current buffer (\fIutop-eval-buffer\fR)
\fBC-c C-k\fR Kill a running utop process (\fItop-kill\fR)
\fBC-c C-z\fR Switch to utop process (\fIutop-switch-to-repl\fR)
then you can run \fButop\fR by pressing \fBM-x\fR and typing "utop". \fButop\fR supports
completion in Emacs mode. Just press \fBTab\fR to complete a word. You can
also integrate it with the tuareg, caml or typerex mode. For that add also integrate it with the tuareg, caml or typerex mode. For that add
the following lines to your the following lines to your
.I ~/.emacs .I ~/.emacs
@ -93,7 +118,7 @@ file:
.SH OPTIONS .SH OPTIONS
See See
.B utop --help .B utop --help
for the the list of available options. There is considerable overlap for the full list of available options. There is considerable overlap
with options available for with options available for
.BR ocaml (1). .BR ocaml (1).