mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix: readme typo, removing deprecated docs
This commit is contained in:
parent
2caac44720
commit
726d9be3aa
1 changed files with 3 additions and 15 deletions
18
README.md
18
README.md
|
|
@ -361,10 +361,11 @@ EOF
|
|||
```
|
||||
|
||||
If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table:
|
||||
|
||||
```vim
|
||||
lua <<EOF
|
||||
local ft_to_parser = require"nvim-treesitter.parser".filetype_to_parsername
|
||||
filetype_to_parsername.someft = "python" -- the someft filetype will use the python parser and queries.
|
||||
local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
|
||||
ft_to_parser.someft = "python" -- the someft filetype will use the python parser and queries.
|
||||
EOF
|
||||
```
|
||||
|
||||
|
|
@ -382,19 +383,6 @@ See [Neovim's documentation](https://neovim.io/doc/user/filetype.html#new-filety
|
|||
If you use a git repository for your parser and want to use a specific version, you can set the `revision` key
|
||||
in the `install_info` table for you parser config.
|
||||
|
||||
## 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 information from the syntax tree;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue