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
|
|
@ -22,34 +22,24 @@ WARNING: This is work in progress and requires the latest commit on Neovim
|
|||
==============================================================================
|
||||
QUICK START *nvim-treesitter-quickstart*
|
||||
|
||||
Install the parser for your language
|
||||
|
||||
>vim
|
||||
:TSInstall {language}
|
||||
<
|
||||
|
||||
To get a list of supported languages
|
||||
|
||||
>vim
|
||||
:TSInstall <tab>
|
||||
<
|
||||
|
||||
To install supported parsers and queries, put this in your `init.lua` file:
|
||||
|
||||
To configure `nvim-treesitter`, put this in your `init.lua` file:
|
||||
>lua
|
||||
require'nvim-treesitter.config'.setup {
|
||||
require'nvim-treesitter'.setup {
|
||||
-- A directory to install the parsers and queries to.
|
||||
-- Defaults to the `stdpath('data')/site` dir.
|
||||
install_dir = "/some/path/to/store/parsers",
|
||||
|
||||
-- A list of parser names, or "stable", "unstable", "unmaintained", "unsupported"
|
||||
ensure_install = { "stable", "rust" },
|
||||
|
||||
-- List of parsers to ignore installing (for "stable" etc.)
|
||||
ignore_install = { "javascript" },
|
||||
ignore_install = { "some_parser" },
|
||||
}
|
||||
|
||||
NOTE: You do not need to call `setup` to use this plugin with the default
|
||||
settings!
|
||||
|
||||
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.)
|
||||
|
||||
To check installed parsers and queries, use `:checkhealth nvim-treesitter`.
|
||||
|
||||
==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue