Neovim Treesitter API Reference

Reference Neovim's treesitter Lua API for syntax tree navigation and manipulation.

232|4|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ThePrimeagen/skills --skill neovim-treesitter-api-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Neovim Treesitter API Reference
Source: https://github.com/ThePrimeagen/skills/tree/main/skills/vim.treesitter
Command: npx skills add https://github.com/ThePrimeagen/skills --skill neovim-treesitter-api-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive reference for Neovim's treesitter Lua API, enabling developers to understand and utilize its syntax parsing capabilities.

Core Features & Use Cases

  • API Documentation: Offers detailed information on TSNode, TSTree, TSQuery, and other related types.
  • Code Navigation: Facilitates understanding of how to navigate and inspect syntax trees within Neovim.
  • Use Case: A Neovim plugin developer can use this Skill to quickly look up the correct methods for manipulating syntax trees when building advanced text editing features.

Quick Start

Consult the Neovim Treesitter API Reference for details on the TSNode parent method.

Frequently Asked Questions about Neovim Treesitter API Reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I navigate syntax trees using the Neovim Treesitter Lua API?

To navigate syntax trees using the Neovim Treesitter Lua API, use methods defined on TSNode and TSTree types to inspect parent and child nodes. The API provides type stubs for programmatic traversal within plugin development.

What is a TSNode in Neovim plugin development?

A TSNode in Neovim plugin development represents a node within a parsed syntax tree, exposing Lua API methods to navigate and manipulate its structural relationships. It is fundamental for building advanced text editing configurations.

Do I need to know Lua to use the Neovim Treesitter API?

Yes, you need a solid understanding of Lua to use the Neovim Treesitter API. The API consists of Lua type stubs and method definitions requiring familiarity with Neovim's internal APIs for effective syntax parsing manipulation.

How do I query syntax trees in Neovim using TSQuery?

You query syntax trees in Neovim using the TSQuery type provided by the Treesitter Lua API. It allows developers to define patterns and capture specific nodes during syntax parsing for advanced text editing configurations.

What is the best way to look up Treesitter API methods for Neovim plugin development?

The best way to look up Treesitter API methods for Neovim plugin development is consulting a dedicated API reference. It provides detailed documentation on TSNode, TSTree, and TSQuery types to quickly find correct syntax tree manipulation methods.

Can I use the Treesitter API to build advanced text editing features in Neovim?

Yes, you can use the Treesitter Lua API to build advanced text editing features in Neovim. It provides the necessary type stubs and method definitions for navigating and manipulating syntax trees within your custom plugins.