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
To see a list of available configuration options do M-x customize-group RET clojure-ts.
18
+
19
+
Most configuration changes will require reverting any active clojure-ts-mode buffers.
20
+
21
+
### Indentation
22
+
23
+
clojure-ts-mode currently supports 2 different indentation strategies
24
+
-`semantic`, the default, which tries to match the indentation of clojure-mode and cljfmt
25
+
-`fixed`, [a simple indentation strategy outlined by Tonsky in a blog post](https://tonsky.me/blog/clojurefmt/)
26
+
27
+
Set the var `clojure-ts-indent-style` to change it.
28
+
```emacs-lisp
29
+
(setq clojure-ts-indent-style 'fixed)
30
+
```
31
+
32
+
### Font Locking
33
+
34
+
Too highlight entire rich `comment` expression with the comment font face, set
35
+
```emacs-lisp
36
+
(setq clojure-ts-comment-macro-font-lock-body t)
37
+
```
38
+
39
+
By default this is `nil`, so that anything within a `comment` expression is
40
+
highlighted like regular clojure code.
41
+
15
42
## Rationale
16
43
17
44
[clojure-mode](https://github.com/clojure-emacs/clojure-mode) has served us well
@@ -35,8 +62,6 @@ You can read more about the vision for `clojure-ts-mode` [here](https://metaredu
35
62
36
63
**This library is still under development. Breaking changes should be expected.**
37
64
38
-
You can track the current progress towards an initial release [here](https://github.com/clojure-emacs/clojure-ts-mode/issues/1).
39
-
40
65
## Installation
41
66
42
67
### Emacs 29
@@ -83,11 +108,26 @@ Once installed, evaluate clojure-ts-mode.el and you should be ready to go.
83
108
84
109
### Install libtree-sitter-clojure shared library
85
110
111
+
#### From your OS
112
+
113
+
Some distributions may package the tree-sitter-clojure grammar in their package repositories.
114
+
If yours does you may be able to install tree-sitter-clojure with your system package manager.
115
+
116
+
If the version packaged by your OS is out of date, you may see errors in the `*Messages*` buffer or your clojure buffers will not have any syntax highlighting.
117
+
If this happens you should install the grammar manually with `M-x treesit-install-language-grammar <RET> clojure`.
118
+
119
+
#### Manually
120
+
86
121
The tree-sitter clojure shared library must be available to Emacs.
87
-
If you have `git` and a C compiler (`cc`) available on your system's `PATH`, **then these steps are not necessary**.
122
+
If you have `git` and a C compiler (`cc`) available on your system's `PATH`, **then these steps should not be necessary**.
88
123
clojure-ts-mode will install the grammar when you first open a Clojure file.
89
124
90
125
If clojure-ts-mode fails to automatically install the grammar, you have the option to install it manually.
126
+
127
+
The first way is to run `M-x treesit-install-language-grammar <RET> clojure` in Emacs.
128
+
This is what clojure-ts-mode attempts to do when a suitable grammar is not found.
129
+
130
+
If that fails, you can attempt to download and compile manually.
91
131
All you need is `git` and a C compiler (GCC works well).
92
132
93
133
To start, clone [tree-sitter-clojure](https://github.com/sogaiu/tree-sitter-clojure).
0 commit comments