Fork me on GitHub
#emacs
<
2021-02-07
>
nmkip01:02:11

Hi! Is there a way I can override some evil keys for a specific mode (cider-inspect-mode)?

fedreg01:02:03

I do this to override evil keys for the cider debugger. I imagine you should be able to do something similar for inspect-mode?

(defun my-cider-debug-setup ()
  (evil-make-overriding-map cider--debug-mode-map 'normal)
  (evil-normalize-keymaps))

(add-hook 'cider--debug-mode-hook 'my-cider-debug-setup)

nmkip13:02:41

Thanks!! I'll try to figure out what that does and come back later

nmkip14:02:28

This worked for me:

(defun nmkip/cider-inspector-mode-hook ()
    (general-override-local-mode)
    (general-define-key
     :states 'normal
     :keymaps 'local
     "h" 'cider-inspector-pop
     "H" 'cider-inspector-prev-page
     "j" 'cider-inspector-next-inspectable-object
     "k" 'cider-inspector-previous-inspectable-object
     "l" 'cider-inspector-operate-on-point
     "L" 'cider-inspector-next-page
     "q" 'quit-window
     "r" 'cider-inspector-refresh
     "s" 'cider-inspector-set-page-size
     (kbd "RET") 'cider-inspector-operate-on-point
     [mouse-1] 'cider-inspector-operate-on-click
     ))

fedreg03:02:02

Glad you got it working! Sorry, realized I didn’t give you any explanation of the snippets I posted above 😁

😄 1