mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-09 23:10:11 -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:
|
If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table:
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
local ft_to_parser = require"nvim-treesitter.parser".filetype_to_parsername
|
local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
|
||||||
filetype_to_parsername.someft = "python" -- the someft filetype will use the python parser and queries.
|
ft_to_parser.someft = "python" -- the someft filetype will use the python parser and queries.
|
||||||
EOF
|
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
|
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.
|
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
|
## Adding queries
|
||||||
|
|
||||||
Queries are what `nvim-treesitter` uses to extract information from the syntax tree;
|
Queries are what `nvim-treesitter` uses to extract information from the syntax tree;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue