vim-treesitter

Reference Neovim's vim.treesitter API for functions, queries, and TSNode manipulation.

Updated Oct 2, 2024
One-click install
npx skills add https://github.com/A-NGJ/dotfiles --skill vim-treesitter-a-ngj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vim-treesitter
Source: https://github.com/A-NGJ/dotfiles/tree/main/claude/.claude/skills/vim-treesitter
Command: npx skills add https://github.com/A-NGJ/dotfiles --skill vim-treesitter-a-ngj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive reference for Neovim's vim.treesitter API, helping users understand and utilize its advanced code parsing and manipulation capabilities.

Core Features & Use Cases

  • API Reference: Detailed information on all functions, arguments, and submodules of the vim.treesitter API.
  • Syntax Highlighting & Queries: Understand how to configure and use Treesitter for enhanced syntax highlighting and code analysis.
  • Node Manipulation: Learn to work with TSNode objects for programmatic code inspection and modification.
  • Use Case: A user wants to understand how to write a custom Treesitter query to highlight specific code patterns in their Neovim configuration.

Quick Start

Provide me with the documentation for the vim.treesitter.query.get function.

Frequently Asked Questions about vim-treesitter

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

FAQPage Schema
How do I use the vim.treesitter API in Neovim for syntax highlighting?

The vim.treesitter API in Neovim provides functions and submodules to configure syntax highlighting by parsing code into syntax trees. You can use it to apply advanced code highlighting and manipulate query patterns programmatically.

How do I write a custom Treesitter query to highlight specific code patterns in Neovim?

To write a custom Treesitter query in Neovim, you use the vim.treesitter API to define query patterns that match specific syntax nodes. This allows you to highlight targeted code structures based on the parsed syntax tree.

What is a TSNode object and how do I manipulate it for code inspection in Neovim?

A TSNode object represents a specific node in the parsed syntax tree within Neovim. You can use the vim.treesitter API to inspect and manipulate TSNode objects for programmatic code analysis and modification.

Does the vim.treesitter API support Lua for configuring code parsing in Neovim?

Yes, the vim.treesitter API is accessed and configured using Lua within Neovim. It provides detailed references for Lua functions, arguments, and submodules needed for advanced code parsing and manipulation.

Can I use the vim.treesitter API to inspect and modify code structures programmatically?

Yes, the vim.treesitter API allows you to inspect and modify code structures programmatically by manipulating TSNode objects. It provides functions for deep code parsing and structural code analysis in Neovim.

What are the submodules available in the Neovim vim.treesitter API?

The Neovim vim.treesitter API contains various submodules and functions dedicated to code parsing, syntax highlighting, and query management. These submodules provide the tools needed for in-depth API exploration and practical application.