From cd95789170c3396e89cb5a18ac9ca868a74f863c Mon Sep 17 00:00:00 2001 From: John Stevenson Date: Thu, 11 Jul 2019 15:01:40 +0100 Subject: [PATCH] [Clojure] Keybinding require Clojure repl utils in current namespace Although the Clojure repl utils (clojure.repl) are including in the user namespace in Clojure projects, they are not available in your application namespace. The existing CIDER function cider-repl-require-repl-utils adds the Clojure repl utils into the current namespace, so you can use functions such as doc and source. This is often a source of confusion for those new to Clojure / CIDER. --- CHANGELOG.develop | 2 ++ layers/+lang/clojure/README.org | 1 + layers/+lang/clojure/packages.el | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.develop b/CHANGELOG.develop index c6b77a325..765bec580 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -1190,6 +1190,8 @@ Other: - ~SPC m e i~ interrupt the current evaluation (stop long running process) (thanks to John Stevenson) - ~SPC m e v~ to evaluate s-expression at point (=cider-eval-sexp-at-point=) + - ~SPC m s u~ require Clojure utils into current namespace + i.e. functions =doc= =source= (thanks to John Stevenson) - Fixes: - Remove `cider.nrepl/cider-middleware` in lein quick start setting - Fixed =cider-inspector-prev-page= binding, also add ~p~ as another key diff --git a/layers/+lang/clojure/README.org b/layers/+lang/clojure/README.org index 49169fd7d..6d90ad4ad 100644 --- a/layers/+lang/clojure/README.org +++ b/layers/+lang/clojure/README.org @@ -296,6 +296,7 @@ As this state works the same for all files, the documentation is in global | ~SPC m s r~ | send and eval region in REPL | | ~SPC m s R~ | send and eval region and switch to REPL in =insert state= | | ~SPC m s s~ | switch to REPL or jump to last file or last clj buffer from repl (cider-repl) | +| ~SPC m s u~ | require Clojure utils into current namespace - i.e. functions =doc= =source= | | ~SPC m s x~ | refresh REPL | | ~SPC m s X~ | restart REPL | diff --git a/layers/+lang/clojure/packages.el b/layers/+lang/clojure/packages.el index 53d966afe..b92e88d69 100644 --- a/layers/+lang/clojure/packages.el +++ b/layers/+lang/clojure/packages.el @@ -126,6 +126,7 @@ "ss" (if (eq m 'cider-repl-mode) 'cider-switch-to-last-clojure-buffer 'cider-switch-to-repl-buffer) + "su" 'cider-repl-require-repl-utils "sx" 'cider-ns-refresh "sX" 'cider-restart