mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
docs: add hint on configuring custom filetypes (#5552)
I thought that this functionality was not possible but there's actually an API for it. This seems like a useful place for others to find more information on it.
This commit is contained in:
parent
eb3faef3a4
commit
1bfefd1f98
1 changed files with 12 additions and 0 deletions
12
README.md
12
README.md
|
|
@ -745,3 +745,15 @@ require'nvim-treesitter.configs'.setup {
|
|||
--
|
||||
}
|
||||
```
|
||||
|
||||
#### Using an existing parser for another filetype
|
||||
|
||||
For example, to use the `bash` tree-sitter to highlight file with
|
||||
`filetype=apkbuild`, use:
|
||||
|
||||
```lua
|
||||
vim.treesitter.language.register("bash", "apkbuild")
|
||||
```
|
||||
|
||||
The `bash` tree-sitter must be installed following the usual procedure [as
|
||||
described above](#language-parsers).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue