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?

  • 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 4, 2016 at 11:09

1 Answer 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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.