mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
feat(setup)!: remove ensure_install field
Instead, call `require('nvim-treesitter').install( { ... } )` manually.
This gives users full control over how they want to install parsers
(sync, from grammar, limited concurrency) and obviates the need for
calling `setup` for most users.
This commit is contained in:
parent
73adbe597e
commit
522e0c6991
7 changed files with 37 additions and 46 deletions
16
README.md
16
README.md
|
|
@ -53,17 +53,21 @@ require('lazy').setup(
|
|||
|
||||
```lua
|
||||
require'nvim-treesitter'.setup {
|
||||
-- A list of parser names or tiers ('stable', 'unstable')
|
||||
ensure_install = { 'stable' },
|
||||
|
||||
-- List of parsers to ignore when installing tiers
|
||||
ignore_install = { 'rust' },
|
||||
|
||||
-- Directory to install parsers and queries to
|
||||
install_dir = vim.fn.stdpath('data') .. '/site'
|
||||
-- List of parsers to ignore when installing tiers
|
||||
ignore_install = { },
|
||||
}
|
||||
```
|
||||
|
||||
Parsers and queries can then be installed with
|
||||
|
||||
```lua
|
||||
require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' }
|
||||
```
|
||||
|
||||
(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), adapt [this script](scripts/install-parsers.lua) to your needs.
|
||||
|
||||
Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all available commands.
|
||||
|
||||
# Supported languages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue