Skip to content

Commit 20ac45c

Browse files
dpsuttonbbatsov
authored andcommitted
Move eval commands to a single keymap (#1805)
Move eval commands to a single keymap.
1 parent 780b448 commit 20ac45c

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* [#1736](https://github.com/clojure-emacs/cider/issues/1736): Show "See Also" links for functions/variables in documentation buffers.
2323
* [#1767](https://github.com/clojure-emacs/cider/issues/1767): Add a command `cider-read-and-eval-defun-at-point` to insert the defun at point into the minibuffer for evaluation (bound to `C-c C-v .`).
2424
* [#1646](https://github.com/clojure-emacs/cider/issues/1646): Add an option `cider-apropos-actions` to control the list of actions to be applied on the symbol found by an apropos search.
25+
* [#1783](https://github.com/clojure-emacs/cider/issues/1783): Put eval commands onto single map bound to `C-c C-v`.
2526

2627
### Changes
2728

cider-interaction.el

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,23 @@ passing arguments."
12481248
(form (concat "(" fn-name ")")))
12491249
(cider-read-and-eval (cons form (length form)))))
12501250

1251+
;; Eval maps
1252+
1253+
(defvar cider-eval-commands-map
1254+
(let ((map (define-prefix-command 'cider-eval-commands-map)))
1255+
;; duplicates with C- for convenience
1256+
(define-key map (kbd "C-w") #'cider-eval-last-sexp-and-replace)
1257+
(define-key map (kbd "C-r") #'cider-eval-region)
1258+
(define-key map (kbd "C-n") #'cider-eval-ns-form)
1259+
(define-key map (kbd "C-v") #'cider-eval-sexp-at-point)
1260+
(define-key map (kbd "C-.") #'cider-read-and-eval-defun-at-point)
1261+
;; single key bindings defined last for display in menu
1262+
(define-key map (kbd "w") #'cider-eval-last-sexp-and-replace)
1263+
(define-key map (kbd "r") #'cider-eval-region)
1264+
(define-key map (kbd "n") #'cider-eval-ns-form)
1265+
(define-key map (kbd "v") #'cider-eval-sexp-at-point)
1266+
(define-key map (kbd ".") #'cider-read-and-eval-defun-at-point)))
1267+
12511268

12521269
;; Connection and REPL
12531270

cider-mode.el

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,7 @@ Configure `cider-cljs-lein-repl' to change the ClojureScript REPL to use."]
287287
(define-key map (kbd "C-c C-c") #'cider-eval-defun-at-point)
288288
(define-key map (kbd "C-x C-e") #'cider-eval-last-sexp)
289289
(define-key map (kbd "C-c C-e") #'cider-eval-last-sexp)
290-
(define-key map (kbd "C-c C-v w") #'cider-eval-last-sexp-and-replace)
291-
(define-key map (kbd "C-c C-v r") #'cider-eval-region)
292-
(define-key map (kbd "C-c C-v n") #'cider-eval-ns-form)
293-
(define-key map (kbd "C-c C-v v") #'cider-eval-sexp-at-point)
294-
(define-key map (kbd "C-c C-v .") #'cider-read-and-eval-defun-at-point)
290+
(define-key map (kbd "C-c C-v") 'cider-eval-commands-map)
295291
(define-key map (kbd "C-c M-;") #'cider-eval-defun-to-comment)
296292
(define-key map (kbd "C-c M-e") #'cider-eval-last-sexp-to-repl)
297293
(define-key map (kbd "C-c M-p") #'cider-insert-last-sexp-in-repl)

0 commit comments

Comments
 (0)