@@ -88,6 +88,23 @@ following:
88
88
(setq cider-repl-tab-command #'indent-for-tab-command)
89
89
----
90
90
91
+ == Customizing the `Return` key's behavior
92
+
93
+ Ordinarily, kbd:[Return] immediate sends a form for
94
+ evaluation. If you want to insert a newline into the REPL buffer as
95
+ you're editing, you can do so using kbd:[C-j]. If you are
96
+ entering a lot of longer forms that span multiple lines, it may be
97
+ more convenient to change the keybindings:
98
+
99
+ [source,lisp]
100
+ ----
101
+ (define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
102
+ (define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
103
+ ----
104
+
105
+ This will make kbd:[Return] insert a newline into the REPL buffer
106
+ and kbd:[C-Return] send the form off for evaluation.
107
+
91
108
== Auto-scrolling the REPL on Output
92
109
93
110
Prior to version 0.21.0, the REPL buffer would be automatically re-centered
@@ -119,6 +136,31 @@ user> (+ 1 2)
119
136
120
137
By default, REPL results have no prefix.
121
138
139
+ == Set ns in REPL
140
+
141
+ By default `cider-repl-set-ns` won't require the target ns, just set
142
+ it. That's done with the assumption that you've probably evaluated the
143
+ ns in question already before switching to it (e.g. by doing `C-c C-k`
144
+ in its source file). If you want to change this behaviour (to avoid
145
+ calling `cider-repl-set-ns` and then `(require 'my-ns)` manually), you
146
+ can set:
147
+
148
+ [source,lisp]
149
+ ----
150
+ (setq cider-repl-require-ns-on-set t)
151
+ ----
152
+
153
+ == Customizing the initial REPL namespace
154
+
155
+ Normally, the CIDER REPL will start in the `user` namespace. You can
156
+ supply an initial namespace for REPL sessions in the `repl-options`
157
+ section of your Leiningen project configuration:
158
+
159
+ [source,clojure]
160
+ ----
161
+ :repl-options {:init-ns 'my-ns}
162
+ ----
163
+
122
164
== Customize the REPL Buffer's Name
123
165
124
166
You can customize the buffer name using the variable
@@ -212,34 +254,6 @@ for details.
212
254
Alternatively, you can toggle this behaviour on and off using kbd:[M-x cider-repl-toggle-content-types]
213
255
or the REPL shortcut `toggle-content-types`.
214
256
215
- == Customizing the initial REPL namespace
216
-
217
- Normally, the CIDER REPL will start in the `user` namespace. You can
218
- supply an initial namespace for REPL sessions in the `repl-options`
219
- section of your Leiningen project configuration:
220
-
221
- [source,clojure]
222
- ----
223
- :repl-options {:init-ns 'my-ns}
224
- ----
225
-
226
- == Customizing the `Return` key's behavior
227
-
228
- Ordinarily, kbd:[Return] immediate sends a form for
229
- evaluation. If you want to insert a newline into the REPL buffer as
230
- you're editing, you can do so using kbd:[C-j]. If you are
231
- entering a lot of longer forms that span multiple lines, it may be
232
- more convenient to change the keybindings:
233
-
234
- [source,lisp]
235
- ----
236
- (define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
237
- (define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
238
- ----
239
-
240
- This will make kbd:[Return] insert a newline into the REPL buffer
241
- and kbd:[C-Return] send the form off for evaluation.
242
-
243
257
== REPL history
244
258
245
259
* To make the REPL history wrap around when CIDER reaches the end:
@@ -265,17 +279,3 @@ and kbd:[C-Return] send the form off for evaluation.
265
279
266
280
Note that CIDER writes the history to the file when you kill the REPL
267
281
buffer, which includes invoking `cider-quit`, or when you quit Emacs.
268
-
269
- == Set ns in REPL
270
-
271
- By default `cider-repl-set-ns` won't require the target ns, just set
272
- it. That's done with the assumption that you've probably evaluated the
273
- ns in question already before switching to it (e.g. by doing `C-c C-k`
274
- in its source file). If you want to change this behaviour (to avoid
275
- calling `cider-repl-set-ns` and then `(require 'my-ns)` manually), you
276
- can set:
277
-
278
- [source,lisp]
279
- ----
280
- (setq cider-repl-require-ns-on-set t)
281
- ----
0 commit comments