2

How can I move my cursor in a multiline command in utop? E.g :

utop # let ratio x y =
  let open Float.O in
  of_int x / of_int y
;;

After I execute the above command, if I want to edit the line "let open...", I must press up arrow once then press backspace until the cursor move to the "L" letter. Is there any way to move the cursor around in utop without using backspace too much? (like an edit mode)

Hai Hoang
  • 1,207
  • 2
  • 18
  • 35

1 Answers1

4

For me, on both macOS and Linux, utop works with the standard command line movement key sequences:

  • or Ctrl+B to move one character left
  • or Ctrl+F to move one character right
  • Ctrl+ to move one word to the left
  • Ctrl+ to move one word to the right
  • Ctrl+A to move to the beginning of the line
  • Ctrl+E to move to the end of the line

I'm sure there are more, but these are the ones I know at least.

glennsl
  • 28,186
  • 12
  • 57
  • 75
  • 2
    the command `#utop_bindings;;` does the job. It tell me that Ctrl-n jump cursor to next line and Ctrl-p jump to previous line. – Hai Hoang Jan 21 '19 at 16:09