2022-12-08 01:57:24 +03:00
|
|
|
# tree-sitter-d2
|
|
|
|
|
|
|
|
d2 grammar for tree-sitter.
|
|
|
|
|
2022-12-08 02:22:58 +03:00
|
|
|
References:
|
|
|
|
- https://d2lang.com/
|
|
|
|
|
|
|
|
## Highlights
|
|
|
|
|
|
|
|
![screenshot](./assets/screenshot.png)
|
|
|
|
|
2022-12-10 23:15:19 +03:00
|
|
|
|
|
|
|
# Install
|
|
|
|
|
|
|
|
## Neovim
|
|
|
|
|
|
|
|
Using `nvim-treesitter`, add to your configuration
|
|
|
|
|
|
|
|
```lua
|
|
|
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
|
|
|
parser_config.d2 = {
|
|
|
|
install_info = {
|
|
|
|
url = 'https://github.com/pleshevskiy/tree-sitter-d2',
|
2022-12-21 13:13:56 +03:00
|
|
|
revision = 'main',
|
2022-12-10 23:15:19 +03:00
|
|
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
|
|
|
},
|
|
|
|
filetype = 'd2',
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|