Overview
The:TSUpdate command updates installed parsers to the revision specified in the manifest if the installed version is older. This is a no-op if all specified parsers are already up to date.
Syntax
Optional. One or more language names to update. Can be:
- Specific language names (e.g.,
rust,javascript,python) - Language tiers (
stable,unstable) - If omitted, updates all installed parsers
Behavior
- Updates parsers only if the manifest revision is newer than the installed version
- If no languages are specified, updates all installed parsers
- Update is asynchronous by default
- The command is a no-op if parsers are already at the latest version
- Tab completion shows installed parsers
It is recommended to add
:TSUpdate as a build step in your plugin manager configuration to keep parsers automatically updated.Examples
Update all installed parsers
Update specific languages
Update all stable parsers
Plugin Manager Integration
Add:TSUpdate to your plugin manager’s build/post-install hook:
lazy.nvim
packer.nvim
vim-plug
Synchronous Usage (Lua API)
For synchronous updates in scripts (e.g., bootstrapping), use the Lua API:Related Commands
:TSInstall- Install new parsers:TSUninstall- Remove installed parsers:TSLog- View update operation logs
Source Implementation
Implemented inplugin/nvim-treesitter.lua:53-60: