Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orzechowskid/tsi.el
treesitter-based indendentation for emacs 28 and 27
https://github.com/orzechowskid/tsi.el
emacs tree-sitter
Last synced: 3 months ago
JSON representation
treesitter-based indendentation for emacs 28 and 27
- Host: GitHub
- URL: https://github.com/orzechowskid/tsi.el
- Owner: orzechowskid
- License: gpl-3.0
- Created: 2021-09-22T14:19:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-31T14:31:10.000Z (almost 2 years ago)
- Last Synced: 2024-02-17T07:36:24.305Z (9 months ago)
- Topics: emacs, tree-sitter
- Language: Emacs Lisp
- Homepage:
- Size: 101 KB
- Stars: 46
- Watchers: 3
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tsi.el: tree-sitter indentation minor mode for Emacs
use the syntax tree provided by [the `tree-sitter` minor mode](https://emacs-tree-sitter.github.io/tree-sitter-mode/) as the basis for indentation.
![tests?](https://github.com/orzechowskid/tsi.el/actions/workflows/github-actions.yml/badge.svg?branch=main)
Supported languages:
- Javascript/Typescript/JSX/TSX
- JSON
- CSS/SCSS## an important note
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.
## Installation
0. Dependencies: make sure you have [`tree-sitter`](https://emacs-tree-sitter.github.io/installation/) installed already.
1. Install: download this package and place `tsi.el`, and the desired language-specific `tsi-.el` files, inside a directory on your `load-path`.
or install this repository via `straight.el` which does these things for you: `(straight-use-package '(tsi :type git :host github :repo "orzechowskid/tsi.el"))`
4. Require: `(require 'tsi-)`
5. Enable: `(tsi--mode t)`## Configuration
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- [RET]`.
## Bugs
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.
## Contributing
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`](https://github.com/jorgenschaefer/emacs-buttercup) framework, and can be run via the following shell command:
`$ emacs -batch -q -L . -l tsi-.test`
## License
GPLv3. see LICENSE in the top level of this repository.