Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nverno/snippet-ts-mode
Emacs major mode for Yasnippet snippets using tree-sitter
https://github.com/nverno/snippet-ts-mode
emacs tree-sitter yasnippet
Last synced: about 1 month ago
JSON representation
Emacs major mode for Yasnippet snippets using tree-sitter
- Host: GitHub
- URL: https://github.com/nverno/snippet-ts-mode
- Owner: nverno
- License: gpl-3.0
- Created: 2024-04-22T21:35:06.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-11-09T07:00:58.000Z (3 months ago)
- Last Synced: 2024-11-09T08:16:53.823Z (3 months ago)
- Topics: emacs, tree-sitter, yasnippet
- Language: Emacs Lisp
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snippet 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 yasnippet snippets using the tree-sitter
grammar from [tree-sitter-yasnippet](https://github.com/nverno/tree-sitter-yasnippet).Features:
- font-locking
- basic indentation inside elisp code regions
- some interactive commands to move between fields and increment field indices.
- completion-at-point: for elisp in code regions and for snippet headers
- elisp xref in code regions**WIP**: Use elisp parser in elisp code regions.
![example](doc/snippet.png)
## Installing
Emacs 29.1 or above with tree-sitter support is required.
Tree-sitter starter guide: https://git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide?h=emacs-29
### Install tree-sitter parser for yasnippet
Add the source to `treesit-language-source-alist`.
```elisp
(add-to-list
'treesit-language-source-alist
'(yasnippet "https://github.com/nverno/tree-sitter-yasnippet"))
```Optionally, install grammar for `elisp`.
Then run `M-x treesit-install-language-grammar` and select `yasnippet` to install.
### Install snippet-ts-mode.el from source
- Clone this repository
- Add the following to your emacs config```elisp
(require "[cloned nverno/snippet-ts-mode]/snippet-ts-mode.el")
```