I am a new to ocaml. couldn't install rlwrap since I use a school computer. So I have to stick to emacs tuareg.
My question is: How to bind an up arrow key to the previous command in tuareg?
Just use M+p instead of the arraw key :) But you can also add the following lines to your .emacs file:
(add-hook 'tuareg-interactive-mode-hook
(lambda ()
(local-set-key (kbd "<up>") 'comint-previous-input)
)
)