2

Is there any way to use "arrow-up" button to scroll in latest searched words immediately after using isearch-forward? For now, in order to use the "arrow-up" key for this purpose, I am first required to do either of the following things:

  1. M-p (mapped to isearch-ring-retreat in this context). Unfortunately my brain has limited capacity for remembering keyboard shortcuts, so I don't like this solution, "arrow-up" is more intuitive for me and I tend to remember it. Maybe I can bind the "arrow-up" key to isearch-ring-retreat only inside isearch context?
  2. By clicking the mouse on the isearch prompt that had opened. This is inconvenient as it requires to use the mouse. Maybe I can change some isearch properties so that this happens by default?

Thanks!

1 Answer 1

2

OK, after further investigation I actually found a solution that seems to achieve what I was looking for. I added the following to my init.el:

(progn
  (define-key isearch-mode-map (kbd "<up>") 'isearch-ring-retreat )
  (define-key isearch-mode-map (kbd "<down>") 'isearch-ring-advance )
)

Credit goes to http://ergoemacs.org/emacs/emacs_isearch_by_arrow_keys.html

1
  • Welcome to Emacs, land of the free! If you don't like something, rebind it. Nov 8, 2021 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.