Skip to content

Commit

Permalink
Move eval commands to a single keymap (#1805)
Browse files Browse the repository at this point in the history
Move eval commands to a single keymap.
  • Loading branch information
dpsutton authored and bbatsov committed Jul 16, 2016
1 parent 780b448 commit 20ac45c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* [#1736](https://github.com/clojure-emacs/cider/issues/1736): Show "See Also" links for functions/variables in documentation buffers.
* [#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 .`).
* [#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.
* [#1783](https://github.com/clojure-emacs/cider/issues/1783): Put eval commands onto single map bound to `C-c C-v`.

### Changes

Expand Down
17 changes: 17 additions & 0 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,23 @@ passing arguments."
(form (concat "(" fn-name ")")))
(cider-read-and-eval (cons form (length form)))))

;; Eval maps

(defvar cider-eval-commands-map
(let ((map (define-prefix-command 'cider-eval-commands-map)))
;; duplicates with C- for convenience
(define-key map (kbd "C-w") #'cider-eval-last-sexp-and-replace)
(define-key map (kbd "C-r") #'cider-eval-region)
(define-key map (kbd "C-n") #'cider-eval-ns-form)
(define-key map (kbd "C-v") #'cider-eval-sexp-at-point)
(define-key map (kbd "C-.") #'cider-read-and-eval-defun-at-point)
;; single key bindings defined last for display in menu
(define-key map (kbd "w") #'cider-eval-last-sexp-and-replace)
(define-key map (kbd "r") #'cider-eval-region)
(define-key map (kbd "n") #'cider-eval-ns-form)
(define-key map (kbd "v") #'cider-eval-sexp-at-point)
(define-key map (kbd ".") #'cider-read-and-eval-defun-at-point)))


;; Connection and REPL

Expand Down
6 changes: 1 addition & 5 deletions cider-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,7 @@ Configure `cider-cljs-lein-repl' to change the ClojureScript REPL to use."]
(define-key map (kbd "C-c C-c") #'cider-eval-defun-at-point)
(define-key map (kbd "C-x C-e") #'cider-eval-last-sexp)
(define-key map (kbd "C-c C-e") #'cider-eval-last-sexp)
(define-key map (kbd "C-c C-v w") #'cider-eval-last-sexp-and-replace)
(define-key map (kbd "C-c C-v r") #'cider-eval-region)
(define-key map (kbd "C-c C-v n") #'cider-eval-ns-form)
(define-key map (kbd "C-c C-v v") #'cider-eval-sexp-at-point)
(define-key map (kbd "C-c C-v .") #'cider-read-and-eval-defun-at-point)
(define-key map (kbd "C-c C-v") 'cider-eval-commands-map)
(define-key map (kbd "C-c M-;") #'cider-eval-defun-to-comment)
(define-key map (kbd "C-c M-e") #'cider-eval-last-sexp-to-repl)
(define-key map (kbd "C-c M-p") #'cider-insert-last-sexp-in-repl)
Expand Down

0 comments on commit 20ac45c

Please sign in to comment.