From ae26a51ec4afbfb697f4be1419f5eb4e77783146 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 27 Apr 2023 14:58:03 -0400 Subject: [PATCH] Add custom evil lookup function --- emacs/.emacs.d/config/init-evil.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs/.emacs.d/config/init-evil.el b/emacs/.emacs.d/config/init-evil.el index eb13d09..74929db 100644 --- a/emacs/.emacs.d/config/init-evil.el +++ b/emacs/.emacs.d/config/init-evil.el @@ -10,7 +10,16 @@ (evil-define-key 'motion 'global "j" #'evil-next-visual-line "k" #'evil-previous-visual-line) + (defun my-evil-lookup-func () + "Context-aware `evil-lookup-func'" + (cond + ((and (eq major-mode 'emacs-lisp-mode) + (thing-at-point 'symbol)) + (helpful-symbol (intern (thing-at-point 'symbol)))) + ((eldoc--supported-p) (eldoc t)) + ((thing-at-point 'word) (consult-man (thing-at-point 'word t))))) :custom + (evil-lookup-func #'my-evil-lookup-func) (evil-undo-system 'undo-fu) (evil-split-window-below t) (evil-vsplit-window-right t))