Overview
The:TSInstall command downloads, compiles, and installs treesitter parsers for specified languages. Installation is performed asynchronously and includes both the parser and corresponding query files.
Syntax
One or more language names to install. Can be:
- Specific language names (e.g.,
rust,javascript,python) stable- Install all stable parsersunstable- Install all unstable parsersall- Install all available parsers (not recommended)
Force installation even if the parser is already installed. This will reinstall and overwrite existing parsers.
Behavior
- Installation is asynchronous by default
- The command is a no-op if the parser(s) are already installed (unless
!is used) - Parsers are installed to
stdpath('data')/site/by default (configurable viasetup()) - The installation directory is automatically prepended to
runtimepath - Tab completion shows available parsers that can be installed
The parser installation directory can be customized using
require'nvim-treesitter'.setup({ install_dir = "/custom/path" }) before running installation commands.Examples
Install a single language
Install multiple languages
Install all stable parsers
Force reinstall
Related Commands
:TSInstallFromGrammar- Install parsers and regenerateparser.cfrom grammar:TSUpdate- Update installed parsers to latest versions:TSUninstall- Remove installed parsers:TSLog- View installation logs
Source Implementation
Implemented inplugin/nvim-treesitter.lua:29-37: