lang/clojure: group & update evil integration

Also removes evil-normalize-keymaps on cider-repl-mode-hook, because cider-repl-mode isn't a minor mode. The purpose of evil-normalize-keymaps is to ensure evil is aware of evil keybinds in minor-mode keymaps when it is first enabled.
This commit is contained in:
Henrik Lissner 2018-10-16 02:03:23 -04:00 committed by GitHub
parent a25257d8da
commit 4fc7de442e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,17 +47,6 @@
cider-repl-wrap-history nil
cider-stacktrace-default-filters '(tooling dup))
(when (featurep! :feature evil +everywhere)
(evil-define-key 'insert cider-repl-mode-map
[S-return] #'cider-repl-newline-and-indent)
(evil-define-key 'normal cider-repl-history-mode-map
"q" 'cider-repl-history-quit
[return] 'cider-repl-history-insert-and-quit
"l" 'cider-repl-history-occur
"s" 'cider-repl-history-search-forward
"r" 'cider-repl-history-search-backward
"U" 'cider-repl-history-undo-other-window))
;; TODO: Add mode-local labels when general support is in.
(map! :localleader
(:map clojure-mode-map
@ -106,8 +95,17 @@
:n "b" #'cider-switch-to-repl-buffer
:n "B" #'+clojure|cider-switch-to-repl-buffer-and-switch-ns
:n "c" #'cider-repl-clear-buffer)))
(when (featurep! :feature evil +everywhere)
(add-hook 'cider-repl-mode-hook #'evil-normalize-keymaps)))
(evil-define-key 'insert cider-repl-mode-map
[S-return] #'cider-repl-newline-and-indent)
(evil-define-key 'normal cider-repl-history-mode-map
"q" 'cider-repl-history-quit
[return] 'cider-repl-history-insert-and-quit
"l" 'cider-repl-history-occur
"s" 'cider-repl-history-search-forward
"r" 'cider-repl-history-search-backward
"U" 'cider-repl-history-undo-other-window)))
(def-package! clj-refactor
:hook (clojure-mode . clj-refactor-mode)