Last active
February 12, 2022 01:19
-
-
Save Quezion/4e18ec42126c8810b7ef23d40a934ec7 to your computer and use it in GitHub Desktop.
Make cider-eval-last-sexp C-x C-e output to REPL buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Makes Emacs do Cursive's default behavior of inserting & evaling at REPL on C-x C-e | |
;; Tested on Feb 11 2021 with Emacs 27.2, CIDER 20220125.1326 | |
;; see discussion https://github.com/clojure-emacs/cider/issues/2617 | |
;; taken from WIP commit https://github.com/suvratapte/cider/commit/c177120ff243e032ee6e120e46ac4cccefc07991#diff-3f8317548fccd07e43ee8e69be1b3171 | |
(defun cider-insert-and-eval-last-sexp-in-repl (&rest args) | |
"Insert the expression preceding point in the REPL buffer and eval." | |
(interactive) | |
(cider-insert-last-sexp-in-repl t) | |
(cider-switch-to-last-clojure-buffer)) | |
(define-key cider-mode-map (kbd "C-x C-e") #'cider-insert-and-eval-last-sexp-in-repl) |
👍 Good suggestion, updated gist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only improvement I would make is to add this a call to
(cider-switch-to-last-clojure-buffer)
for 1:1 behaviour like so: