about summary refs log tree commit diff
path: root/configs/.emacs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-06-23T15·45-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-06-23T15·45-0400
commitbcde7fabc420e4df9b70999d77037c4510816a80 (patch)
tree2ff900f75c3cad20b16e58c57508b1b03eed01b6 /configs/.emacs
parentb757f26394be80941854f81f999647ffde48d5c6 (diff)
Centers evil search results vertically on a page
Diffstat (limited to 'configs/.emacs')
-rw-r--r--configs/.emacs10
1 files changed, 10 insertions, 0 deletions
diff --git a/configs/.emacs b/configs/.emacs
index 33d8c7616095..26200221dcba 100644
--- a/configs/.emacs
+++ b/configs/.emacs
@@ -334,6 +334,16 @@
   (setq evil-replace-state-cursor '("VioletRed3" bar))
   (setq evil-operator-state-cursor '("VioletRed3" hollow))
   (evil-ex-define-cmd (kbd "w") 'save-buffer-always)
+
+  ;; center search results
+  (defadvice evil-search-next
+      (after center-evil-search-next)
+    (call-interactively 'evil-scroll-line-to-center))
+
+  (defadvice evil-search-previous
+      (after center-evil-search-previous)
+    (call-interactively 'evil-scroll-line-to-center))
+
   (add-hook 'org-mode-hook 'evil-local-mode))