Support goto-definition dispatching

Need to learn more about `evil-goto-definition` because it is possible
and even likely that there is a known, friendlier alternative way to
dispatch the goto-definition using Evil's infrastructure. Needed a
hotfix, however, so this will have to suffice for now.
This commit is contained in:
William Carroll 2018-05-29 16:25:01 -04:00
parent e2891432e2
commit c50b730dad

View file

@ -12,6 +12,17 @@
:fetcher github)) :fetcher github))
(general-evil-setup t) (general-evil-setup t)
(defun wpc/goto-definition ()
"Support a goto-definition that dispatches off of the `major-mode'."
(interactive)
(require 'flow-minor-mode)
(cond ((eq major-mode 'rjsx-mode)
(flow-minor-jump-to-definition))
((eq major-mode 'haskell-mode)
(intero-goto-definition))
(t
(evil-goto-definition))))
;; vim... ;; vim...
(use-package evil (use-package evil
:general :general
@ -25,6 +36,8 @@
"sk" 'evil-window-split "sk" 'evil-window-split
"sj" 'wpc/evil-window-split-down "sj" 'wpc/evil-window-split-down
"sj" 'wpc/evil-window-split-down) "sj" 'wpc/evil-window-split-down)
(n
"gd" 'wpc/goto-definition)
(general-unbind m "M-." "C-p") (general-unbind m "M-." "C-p")
(general-unbind n "s" "M-.") (general-unbind n "s" "M-.")
(general-unbind i "C-d" "C-a" "C-e" "C-n" "C-p" "C-k") (general-unbind i "C-d" "C-a" "C-e" "C-n" "C-p" "C-k")