use the syntax tree provided by the tree-sitter
minor mode as the basis for indentation.
Supported languages:
- Javascript/Typescript/JSX/TSX
- JSON
- CSS/SCSS
this package is intended for use in emacs versions 28 and older. emacs 29 will ship with an all-new, native, tree-sitter experience (including treesit-aware major modes for many programming languages) meaning you should not need this package or its dependencies.
- Dependencies: make sure you have
tree-sitter
installed already. - Install: download this package and place
tsi.el
, and the desired language-specifictsi-<foo>.el
files, inside a directory on yourload-path
. or install this repository viastraight.el
which does these things for you:(straight-use-package '(tsi :type git :host github :repo "orzechowskid/tsi.el"))
- Require:
(require 'tsi-<foo>)
- Enable:
(tsi-<foo>-mode t)
Useful variables are members of the relevant language-specific custom group and can be viewed and modified with the command M-x customize-group [RET] tsi-<foo> [RET]
.
If a supported language is not indenting in the way you feel it should, then maybe it's a bug! open an issue and we'll discuss it.
PRs for existing and new languages are most welcome. Please make sure that any changes are accompanied with unit tests (see tsi-typescript.test.el for an example). Unit tests use the super rad buttercup
framework, and can be run via the following shell command:
$ emacs -batch -q -L . -l tsi-<foo>.test
GPLv3. see LICENSE in the top level of this repository.