I like using C-j
to eval-last-sexp
but paredit-mode (which I otherwise like) overrides this to paredit-newline
. Looking in the paredit-mode docs I don't see anything like a paredit-mode-hook
defined where I can add-hook
to call local-set-key
or a similar function.
Anyone have a suggestion?
Update
After trying out the two answers below and not having much success, I think the problem may be related to the fact that paredit is getting loaded in a few different contexts? To wit, I am opening both Common Lisp, Clojure and Emacs Lisp files, all of which can use paredit. Sadly, the various forms of eval-last-sexp
have slightly different names in each mode, so I can't define the key once for everything. Rather, I need to bind the key based on the major mode that I am in also. Hopefully that adds another useful data point.