Neovim plugin with support for the Kriol Tree Sitter
# kriol.nvim
Neovim integration for Kriol.
This plugin registers the Kriol Tree-sitter parser and adds `.kr` / `.kriol`
filetype detection.
Highlight queries are loaded from `kriol-tree-sitter`. `kriol.nvim` does not
copy them, so the grammar repository remains the single source of truth.
## Requirements
- Neovim 0.11.x
- `nvim-treesitter`
- a C compiler for `:TSInstall kriol`
For Neovim 0.11.x, use the `master` branch of `nvim-treesitter`. The newer
main branch targets Neovim 0.12/nightly and uses a different setup API.
## Installation
With `lazy.nvim`:
```lua
return {
{
"kriol-lang/kriol.nvim",
dependencies = {
{
"nvim-treesitter/nvim-treesitter",
branch = "master",
build = ":TSUpdate",
},
{
"kriol-lang/kriol-tree-sitter",
name = "tree-sitter-kriol",
lazy = false,
},
},
main = "kriol",
opts = {},
},
}
```
Then install the parser:
```vim
:TSInstall kriol
```
Enable Tree-sitter highlighting in your normal `nvim-treesitter` setup:
```lua
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
},
})
```
## Configuration
The default setup is:
```lua
require("kriol").setup({
parser_url = "
github.com",
parser_branch = "main",
filetypes = {
kr = "kriol",
kriol = "kriol",
},
warn_missing_queries = true,
})
```
Use a local grammar checkout while developing the parser. Add the checkout to
`runtimepath` so Neovim can load its `queries/kriol/highlights.scm` symlink:
```lua
vim.opt.runtimepath:prepend("/path/to/kriol-tree-sitter")
require("kriol").setup({
parser_url = "/path/to/kriol-tree-sitter",
})
```
## Verification
Open a `.kr` or `.kriol` file and run:
```vim
:set filetype?
:InspectTree
```