mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 00:10:04 -04:00
Allow user configure parsers using metatables
This commit is contained in:
parent
a47c83d12d
commit
76486942e7
2 changed files with 40 additions and 12 deletions
13
README.md
13
README.md
|
|
@ -275,6 +275,19 @@ EOF
|
|||
You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`.
|
||||
Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`.
|
||||
|
||||
## Update parsers used_by
|
||||
|
||||
Sometimes needs to use some parser for different filetype.
|
||||
|
||||
Add the following snippet to your `init.vim`:
|
||||
|
||||
```vim
|
||||
lua <<EOF
|
||||
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
||||
parser_config.typescript.used_by = "javascriptflow"
|
||||
EOF
|
||||
```
|
||||
|
||||
## Adding queries
|
||||
|
||||
Queries are what `nvim-treesitter` uses to extract informations from the syntax tree; they are
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue