You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These color schemes will work for other languages, too.
31
52
32
-
Want to put your parser to test? Check out [syntax_test_edn.edn](./test_syntax/syntax_test_edn.edn) and [syntax_test_clojure.cljc](./test_syntax/syntax_test_clojure.cljc).
33
53
34
54
# Formatter/indenter
35
55
36
-
Clojure Sublimed includes support for both [Simple Clojure Formatting rules](https://tonsky.me/blog/clojurefmt/) and [cljfmt](https://github.com/weavejester/cljfmt/).
56
+
Clojure Sublimed includes support for both [Better Clojure Formatting](https://tonsky.me/blog/clojurefmt/) and [cljfmt](https://github.com/weavejester/cljfmt/).
37
57
38
-
Simple Clojure Formatting doesn’t require REPL connection, any Clojure runtime or external tools. It is enabled by default.
58
+
Better Clojure Formatting doesn’t require REPL connection, Clojure runtime or external tools. It is enabled by default.
39
59
40
-
`cljfmt` requires `cljfmt` binary to be on `$PATH`. Enable it by setting `"formatter": "cljfmt"` in Clojure Sublimed settings.
60
+
To enable `cljfmt`:
61
+
62
+
- Download `cljfmt` binary from `https://github.com/weavejester/cljfmt/releases/latest`
63
+
- Add `cljfmt` to `$PATH`
64
+
- Add `"clojure_sublimed_formatter": "cljfmt"` to `Preferences: Settings`
41
65
42
66
To reformat whole file, run `Clojure Sublimed: Reindent`. If you have non-empty selection, it will only reformat selected lines.
43
67
44
-
To enable reindenting/formatting on save, add `"format_on_save": true` to settings. ([See how to edit settings](#editing-settings))
68
+
To enable reindenting/formatting on save, add `"clojure_sublimed_format_on_save": true` to `Preferences: Settings`.
45
69
46
70
To enable correct indentations as you type code, rebind `Enter` to `Clojure Sublimed: Insert Newline`:
47
71
@@ -53,7 +77,6 @@ To enable correct indentations as you type code, rebind `Enter` to `Clojure Subl
Best way to do it is through running `Preferences: Clojure Sublimed Key Bindings`.
57
80
58
81
# REPL clients
59
82
@@ -89,16 +112,23 @@ How to choose which REPL to use?
89
112
1. Are you on JVM? Use Socket REPL.
90
113
2. On JVM and only have nREPL? Use JVM nREPL.
91
114
3. CLJS? Use ShadowCLJS REPL.
92
-
4. Otherwise (e.g. babashka) use Raw nREPL.
115
+
4. Otherwise (e.g. babashka, sci, ...) use Raw nREPL.
93
116
94
117
We intentionally excluded following features:
95
118
96
119
-[ ] Autocomplete. Static analysis is much simpler and much more reliable than requiring an always-live connection to the working app.
97
120
98
121
Look at [Sublime LSP](https://github.com/sublimelsp/LSP) with [Clojure LSP](https://github.com/clojure-lsp/clojure-lsp) or [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) with [clj-kondo](https://github.com/ToxicFrog/SublimeLinter-contrib-clj-kondo) if you need autocompletion.
99
122
123
+
100
124
# How to use
101
125
126
+
Clojure Sublimed will not run your app for you. Use any other way, e.g.:
127
+
128
+
- Separate terminal app
129
+
- Terminus plugin
130
+
- Sublime Executor plugin
131
+
102
132
For Clojure apps:
103
133
104
134
1. Run Socket Server, e.g. with either
@@ -126,6 +156,7 @@ For other nREPL apps:
126
156
1. Run nREPL server.
127
157
2. Run `Clojure Sublimed: Connect to raw nREPL` command.
128
158
159
+
129
160
## Evaluating code from buffer
130
161
131
162
From here you have three options:
@@ -150,16 +181,19 @@ By default, Clojure Sublimed will also print evaluation time if it takes more th
Sometimes you want to copy evaluation result. It is recommended to rebind `Cmd+C`/`Ctrl+C` from `copy` to `sublime_clojure_copy`. This will copy evaluation result if inside evaluated region and fallback to default `copy` otherwise.
156
188
189
+
157
190
## Interrupting
158
191
159
192
If your evaluation runs too long and you want to interrupt it, run `Clojure Sublimed: Interrupt Pending Evaluations`:
Watches are great alternative to debug prints: they allow you to monitor intermediate values during function execution right in the editor.
@@ -184,6 +219,7 @@ This is how they work:
184
219
185
220
Watches are only supported in Socket REPL.
186
221
222
+
187
223
## Looking up symbol
188
224
189
225
To show symbol info, run `Clojure Sublimed: Toggle Symbol Info`:
@@ -192,6 +228,7 @@ To show symbol info, run `Clojure Sublimed: Toggle Symbol Info`:
192
228
193
229
Universal `Clojure Sublimed: Toggle Info` command acts as either `Toggle Stacktrace` or `Toggle Symbol Info`, depending on context.
194
230
231
+
195
232
## Binding keys to eval custom code
196
233
197
234
Every project is different, and sometimes it’s convenient to run a piece of code so often you’d want it on a shortcut. It might be a namespace reload, test execution, database reconnect, linter, formatter — possibilities are endless.
@@ -226,6 +263,7 @@ Reload code with [clj-reload](https://github.com/tonsky/clj-reload):
226
263
"args": {"code": "(clj-reload.core/reload)"}}
227
264
```
228
265
266
+
229
267
## Transforming code before eval
230
268
231
269
You can also modify eval to run a transformed version of code under cursor/inside selection.
@@ -289,10 +327,12 @@ Run test under cursor at work:
289
327
290
328

291
329
330
+
292
331
## Clearing results
293
332
294
333
Finally, to clear evaluation results run `Clojure Sublimed: Clear Evaluation Results`.
295
334
335
+
296
336
## Editing settings
297
337
298
338
To edit settings, run `Preferences: Clojure Sublimed Settings` command.
@@ -311,6 +351,7 @@ in `Clojure Sublimed.sublime-settings` becomes
311
351
312
352
in `Preferences.sublime-settings`. Settings from `Preferences.sublime-settings` take priority.
313
353
354
+
314
355
## Session-wide settings
315
356
316
357
It is sometimes desirable to set dynamic Clojure vars for the whole session. To do that, edit `"eval_shared"` setting. For example:
@@ -321,6 +362,7 @@ It is sometimes desirable to set dynamic Clojure vars for the whole session. To
321
362
322
363
This will be applied to every evaluation.
323
364
365
+
324
366
# Default Key Bindings
325
367
326
368
Clojure Sublimed comes with no keybindings enabled by default to guarantee they won’t conflict with any other extension (Sublime Text’s limitation).
Hi there! Thank you for installing Clojure Sublimed.
2
2
3
-
A few important points to help you get started:
3
+
How to get started:
4
4
5
-
- Assign `Clojure (Sublimed)` syntax to your Clojure files: `View` → `Syntax` → `Open all with current extension as...` → `Clojure Sublimed` → `Clojure (Sublimed)` (this step is required for everything else to work)
6
-
- Make sure you have nREPL version 0.8+
7
-
- Connect using `Clojure Sublimed: Connect`
8
-
- Configure key bindings using `Preferences: Clojure Sublimed Key Bindings`
5
+
6
+
Associate syntax with *.clj* files (only needs to be done once)
0 commit comments