Skip to content

Commit

Permalink
tweak(isearch): enable ring scrolling using UP/DOWN & C-j/C-k
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 9, 2023
1 parent 1fb5994 commit 04e985f
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions core/me-builtin.el
Original file line number Diff line number Diff line change
Expand Up @@ -1739,15 +1739,15 @@ Useful for quickly switching to an open buffer."
(windmove-default-keybindings 'shift))

(use-package pulse
:straight (:type built-in)
:init
;; Add visual pulse when changing focus, like beacon but built-in
;; From https://karthinks.com/software/batteries-included-with-emacs/
(defun +pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command scroll-down-command recenter-top-bottom other-window))
(advice-add command :after #'+pulse-line)))
:straight (:type built-in)
:init
;; Add visual pulse when changing focus, like beacon but built-in
;; From https://karthinks.com/software/batteries-included-with-emacs/
(defun +pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command scroll-down-command recenter-top-bottom other-window))
(advice-add command :after #'+pulse-line)))

(use-package transient
:straight (:type built-in)
Expand All @@ -1756,6 +1756,14 @@ Useful for quickly switching to an open buffer."
(keymap-set transient-map "<escape>" 'transient-quit-one)
(keymap-set transient-map "q" 'transient-quit-one))

(use-package isearch
:straight (:type built-in)
:config
;; Scroll in isearch history using UP/DOWN or C-j/C-k
(keymap-set isearch-mode-map "C-j" #'isearch-ring-advance)
(keymap-set isearch-mode-map "C-k" #'isearch-ring-retreat)
(keymap-set isearch-mode-map "<down>" #'isearch-ring-advance)
(keymap-set isearch-mode-map "<up>" #'isearch-ring-retreat))

(provide 'me-builtin)

Expand Down

0 comments on commit 04e985f

Please sign in to comment.