2

In normal mode I can't jump to definition with ternjs or cider modes. I have to go to insert then hit M-.

Is that the evil way? Should I have M-. bound to another function that checks what mode you are in and does the proper thing accordingly?

Justin Thomas
  • 245
  • 1
  • 8
  • This is because Evil has defined its own commands bound to `M-.` and `M-,` in normal state, so they'll take precedence when doing key lookup. Insert state does not define them, so that's why key lookup finds the commands you're after. The easy solution for this is unbinding the commands in normal state. – wasamasa Jun 04 '16 at 11:09

1 Answers1

1

Just found out you can use set-key-for-mode. Seems to be just what I wanted.

 (evil-leader/set-key-for-mode 'clojure-mode "." 'cider-find-dwim
                                                "," 'cider-pop-back
                                                "<SPC>j" 'cider-jack-in             
                                                "<SPC>t" 'cider-test-run-test
                                                "er" 'cider-eval-region
                                                "ee" 'cider-eval-last-sexp
                                                "ex" 'cider-eval-last-sexp-and-replace
                                                "eb" 'cider-eval-buffer
                                                "<SPC>d" 'cider-doc)
Justin Thomas
  • 245
  • 1
  • 8