Ensure isearch and evil-searches center vertically on the screen

I may revert this one day. Checking this in so that one day I can revert it.
This commit is contained in:
William Carroll 2020-01-10 20:35:15 +00:00
parent eb748071ca
commit 5a1b869af3

View file

@ -212,5 +212,18 @@
(key-chord-mode 1) (key-chord-mode 1)
(key-chord-define evil-insert-state-map "jk" 'evil-normal-state)) (key-chord-define evil-insert-state-map "jk" 'evil-normal-state))
;; Ensure the Evil search results get centered vertically.
;; TODO: Consider packaging this up for others.
(progn
(defadvice isearch-update
(before advice-for-isearch-update activate)
(evil-scroll-line-to-center (line-number-at-pos)))
(defadvice evil-search-next
(after advice-for-evil-search-next activate)
(evil-scroll-line-to-center (line-number-at-pos)))
(defadvice evil-search-previous
(after advice-for-evil-search-previous activate)
(evil-scroll-line-to-center (line-number-at-pos))))
(provide 'wpc-keybindings) (provide 'wpc-keybindings)
;;; wpc-keybindings.el ends here ;;; wpc-keybindings.el ends here