Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Neovim
  3. nvim-treehopper

nvim-treehopper

GPL-3.0Lua

A Neovim plugin for region selection using hints on abstract syntax tree nodes powered by tree-sitter.

GitHubGitHub
465 stars17 forks0 contributors

What is nvim-treehopper?

Treehopper is a Neovim plugin that provides region selection using hints on the abstract syntax tree nodes of a document. It solves the problem of imprecise text selection in code editing by allowing developers to select regions based on the underlying syntax structure rather than plain text. This enables more accurate and efficient manipulation of code blocks, functions, or other syntactic elements.

Target Audience

Neovim users who write code and want more precise, semantic text selection and navigation capabilities, particularly those working with languages supported by tree-sitter parsers.

Value Proposition

Developers choose Treehopper because it offers AST-aware selection that is more accurate than traditional text objects, integrates seamlessly with tree-sitter and LSP, and provides a fast, hint-based interface for navigating code structure without leaving the keyboard.

Overview

Region selection with hints on the AST nodes of a document powered by treesitter

Use Cases

Best For

  • Selecting entire function bodies or code blocks precisely
  • Navigating complex nested syntax structures in code
  • Editing code with accurate AST-aware text objects
  • Integrating tree-sitter parsing with Neovim motions
  • Improving efficiency in refactoring or code manipulation tasks
  • Working with languages that have robust tree-sitter parsers

Not Ideal For

  • Users of editors other than Neovim or those on older Neovim versions below 0.7.2
  • Developers working primarily with languages lacking reliable tree-sitter parsers or LSP support
  • Teams preferring minimal plugin ecosystems and avoiding dependencies like hop.nvim
  • Scenarios where visual, non-hint-based selection is preferred for accessibility or simplicity

Pros & Cons

Pros

AST-Powered Precision

Selects code regions based on syntax nodes rather than text, enabling more accurate manipulation of functions or blocks, as shown in the demo GIF.

Tree-Sitter Integration

Uses tree-sitter parsers for robust syntax analysis when available, ensuring reliable AST generation for supported languages, per the README.

LSP Fallback Mechanism

Falls back to Neovim's built-in LSP with selectionRange if no parser exists, broadening compatibility but with potential accuracy trade-offs.

Configurable Hint System

Allows customization of hint keys for fast navigation, improving workflow efficiency with user-defined shortcuts, as detailed in the configuration section.

Cons

Parser and LSP Dependency

Requires installation of tree-sitter parsers or LSP setup, which can be complex and language-specific, limiting out-of-the-box functionality.

Neovim Exclusivity

Only works with Neovim 0.7.2+, excluding users of Vim or other editors, as stated in the requirements.

Additional Setup Complexity

Needs key mappings and dependency on hop.nvim for movement features, adding configuration steps that may deter users seeking plug-and-play solutions.

Frequently Asked Questions

Quick Stats

Stars465
Forks17
Contributors0
Open Issues5
Last commit1 year ago
CreatedSince 2021

Tags

#nvim-treesitter#code-editing#vim-motions#neovim-plugin#tree-sitter#lsp-integration#neovim#ast-navigation#text-selection

Built With

N
Neovim
T
Tree-sitter
L
Lua

Included in

Neovim20.6k
Auto-fetched 1 day ago

Related Projects

tree-climber.nvimtree-climber.nvim

tree-climber.nvim is a Neovim plugin that provides intuitive motions for navigating and manipulating the syntax tree generated by Tree-sitter. It enables developers to move between nodes (parent, child, siblings) and swap neighboring nodes directly within the abstract syntax tree, enhancing code editing efficiency. ## Key Features - **Tree Navigation** — Jump to parent, child, next sibling, and previous sibling nodes within the Tree-sitter syntax tree. - **Node Swapping** — Swap neighboring nodes to quickly restructure code. - **Node Selection** — Select nodes as text objects using a mapping like `in` for "inner node." - **Multi-Language Support** — Works across multi-language files and within comments, unlike some alternatives. - **Depth Preservation** — Maintains tree depth between jumps, allowing easy return to previous positions. - **Single-Child Squashing** — Simplifies navigation by collapsing parents with only one child. ## Philosophy tree-climber.nvim aims to provide a unified, abstract way to navigate Tree-sitter trees without requiring per-language configurations, making it a versatile tool for code editing.

Stars158
Forks6
Last commit9 months ago
treesitter-indent-object.nvimtreesitter-indent-object.nvim

Context-aware indent textobject powered by Treesitter. `vai` to select current context.

Stars74
Forks2
Last commit11 months ago
treemonkey.nvimtreemonkey.nvim

treemonkey.nvim is a Neovim plugin designed for selecting Tree-sitter nodes within code using a label-based system. It addresses common problems in similar plugins where overlapping node positions make selection ambiguous or visually confusing. ## Key Features - **Hierarchical Labeling** — Labels start of nodes with lowercase letters and ends with corresponding uppercase letters to distinguish boundaries. - **Interactive Selection** — Prompts users to input labels and iteratively refines choices when labels are hidden by others. - **Overlap Resolution** — Intelligently handles cases where node positions overlap, ensuring the intended node can be selected. - **Customizable Highlighting** — Allows configuration of highlight groups like backdrop colors for better visual integration. - **Injection Support** — Can be configured to ignore or include language injections via Tree-sitter. ## Philosophy It approaches node selection like a monkey navigating an Abstract Syntax Tree—iteratively and adaptively—to provide a reliable and user-friendly experience without visual clutter.

Stars41
Forks0
Last commit2 months ago
sibling-jump.nvimsibling-jump.nvim

Navigate between sibling nodes in your Neovim powered by Tree-sitter

Stars18
Forks0
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub