Skip to content

Treesitter Textobjects

Treesitter Textobjects is a powerful plugin that provides enhanced text objects for Neovim using treesitter, making text manipulation more efficient and intuitive.

What Problem Does It Solve?

Traditional text objects in Neovim can be:

  • Limited in functionality
  • Hard to remember
  • Not flexible enough
  • Inconsistent across modes
  • Difficult to extend

How It Improves Productivity

  1. Enhanced Text Objects:

    • More intuitive objects
    • Better pattern matching
    • Improved accuracy
    • Extended functionality
  2. Efficient Manipulation:

    • Faster text operations
    • Better selection
    • Improved editing
    • Consistent behavior
  3. Advanced Features:

    • Custom text objects
    • Pattern-based selection
    • Context-aware objects
    • Extended operators

How to Use

Basic Usage

  • Use af for around function
  • Use if for inner function
  • Use ac for around class
  • Use ic for inner class

Common Objects

  • Functions
  • Classes
  • Parameters
  • Arguments
  • Statements
  • Blocks

Advanced Features

  • Custom patterns
  • Extended operators
  • Context-aware selection
  • Pattern-based objects