Emacs Init: isearch by Arrow Keys
Here's convenient keys for isearch.
put this in your Emacs Init File:
(progn ;; set arrow keys in isearch. left/right is backward/forward, up/down is history. press Return to exit (define-key isearch-mode-map (kbd "<up>") 'isearch-ring-retreat ) (define-key isearch-mode-map (kbd "<down>") 'isearch-ring-advance ) (define-key isearch-mode-map (kbd "<left>") 'isearch-repeat-backward) (define-key isearch-mode-map (kbd "<right>") 'isearch-repeat-forward) (define-key minibuffer-local-isearch-map (kbd "<left>") 'isearch-reverse-exit-minibuffer) (define-key minibuffer-local-isearch-map (kbd "<right>") 'isearch-forward-exit-minibuffer))
when in isearch, the arrow keys will:
- → next occurrence.
- ← previous occurrence.
- ↑ previous search term.
- ↓ next search term.
- Enter exit isearch.
This way, searching forward/backward is just one single key press, no key combination.
This is especially useful with a command that searches current word. See: Emacs: Search Current Word 🚀.
For basics of isearch, see: Emacs: Search Text in Current File.
Emacs Find Replace
- Emacs: Search Text in Current File
- Emacs: Search Current Word 🚀
- Emacs Init: isearch Whitespace Regex
- Emacs Init: isearch by Arrow Keys
- Emacs: Highlight Word, Line
- Emacs: List Matching Lines
- Emacs: Search Text in Directory
- Emacs: Find Replace in Current File
- Emacs: Interactive Find Replace Text in Directory
- Emacs: Xah Find Replace (xah-find.el) 📦
- Emacs: Regular Expression