Skip to main content

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

:TSUpdate [{language} ...]
language
string
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

:TSUpdate
Updates every parser that was previously installed.

Update specific languages

:TSUpdate rust javascript
Updates only the Rust and JavaScript parsers if newer versions are available.

Update all stable parsers

:TSUpdate stable
Updates all parsers in the stable tier.

Plugin Manager Integration

Add :TSUpdate to your plugin manager’s build/post-install hook:

lazy.nvim

{
  'nvim-treesitter/nvim-treesitter',
  build = ':TSUpdate',
}

packer.nvim

use {
  'nvim-treesitter/nvim-treesitter',
  run = ':TSUpdate',
}

vim-plug

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}

Synchronous Usage (Lua API)

For synchronous updates in scripts (e.g., bootstrapping), use the Lua API:
require('nvim-treesitter').update():wait(300000)  -- max 5 minutes
  • :TSInstall - Install new parsers
  • :TSUninstall - Remove installed parsers
  • :TSLog - View update operation logs

Source Implementation

Implemented in plugin/nvim-treesitter.lua:53-60:
api.nvim_create_user_command('TSUpdate', function(args)
  require('nvim-treesitter.install').update(args.fargs, { summary = true })
end, {
  nargs = '*',
  bar = true,
  complete = complete_installed_parsers,
  desc = 'Update installed treesitter parsers',
})

Build docs developers (and LLMs) love