Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nverno/query-ts-mode
Tree-sitter query major-mode
https://github.com/nverno/query-ts-mode
emacs query tree-sitter
Last synced: 5 days ago
JSON representation
Tree-sitter query major-mode
- Host: GitHub
- URL: https://github.com/nverno/query-ts-mode
- Owner: nverno
- License: gpl-3.0
- Created: 2023-10-12T16:10:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-09T06:58:35.000Z (2 months ago)
- Last Synced: 2024-11-17T05:16:57.000Z (2 months ago)
- Topics: emacs, query, tree-sitter
- Language: Emacs Lisp
- Homepage:
- Size: 295 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tree-sitter query major mode using tree-sitter
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
This package provides a major-mode for tree-sitter queries (nvim) using the tree-sitter
grammar from [tree-sitter-query](https://github.com/nvim-treesitter/tree-sitter-query)Features:
- indentation
- font-locking
- structural navigation with treesitter objectsTo use the embedded regex parser to parse regexes in `match` predicates, install
`regex-ts` from [tree-sitter-regex](https://github.com/tree-sitter/tree-sitter-regex)![example](doc/example-query.png)
## Installing
Emacs 29.1 or above with tree-sitter support is required.
### Install tree-sitter parsers
Add the sources to `treesit-language-source-alist` and run
`treesit-install-language-grammar`.```elisp
(let ((treesit-language-source-alist
'((query "https://github.com/nvim-treesitter/tree-sitter-query")
(regex "https://github.com/tree-sitter/tree-sitter-regex"))))
(dolist (parser (mapcar #'car treesit-language-source-alist))
(treesit-install-language-grammar parser)))
```