uninstall(languages, opts)
Remove the parser and queries for the specified language(s). This deletes both the compiled parser library and the associated query files from the installation directory.Parameters
Language(s) to uninstall. Can be:
- A single language name (e.g.,
"rust") - An array of language names (e.g.,
{ "rust", "javascript" }) - A tier name:
"stable","unstable", or"all"to uninstall all parsers
Uninstall options
Returns
This function does not return a value (returnsnil).
This function is asynchronous but does not return an awaitable object like
install() and update().Usage
Uninstall a Single Parser
Uninstall Multiple Parsers
Uninstall All Parsers
Uninstall with Summary
Uninstall Process
For each language, the function:- Verify: Checks if the parser is managed by nvim-treesitter
- Remove Parser: Deletes the compiled parser library (
.sofile) from theparser/directory - Remove Queries: Deletes query files from the
queries/directory (handles both symlinks and regular directories) - Cleanup: Removes parser metadata from
parser-info/
Behavior Details
- Parser dependencies are not automatically uninstalled (to prevent breaking other parsers that might depend on them)
- If a parser is not found or not managed by nvim-treesitter, a warning is logged
- Query directories are handled differently based on their type:
- Symlinks: Simply unlinked
- Directories: Recursively removed with all contents
Only parsers installed in nvim-treesitter’s configured installation directory are affected. Parsers installed system-wide or via other methods are ignored.
Verification
To check which parsers are managed by nvim-treesitter and can be uninstalled:Parsers installed from other sources or placed anywhere else on
runtimepath will not be listed by get_installed() and cannot be uninstalled via this function.Warnings
You’ll see a warning if you try to uninstall a parser that is:- Not installed
- Not managed by nvim-treesitter
- Installed from a different source
See Also
- install() - Install new parsers
- update() - Update installed parsers
- get_installed() - List installed parsers