You can use M-pboth M-nto navigate up and down in the input history. In addition, the current input can be used as a search pattern, i.e. Enter the start of the command you want to match, then M-ptake you to the next match. This uses the functions nrepl-previous-inputand nrepl-next-input. If you do not like these bindings, you can also re-confirm before <up>and <down>:
(define-key nrepl-mode-map (kbd "<up>") 'nrepl-previous-input)
(define-key nrepl-mode-map (kbd "<down>") 'nrepl-next-input)
Just add this to yours .emacs(and evaluate C-x C-eafter each line if you don't want to restart Emacs). Also note that M-nthey M-pwill most likely be tied to similar functionality in other REPL and comint modes.
source
share