Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Neovim
  3. nvim-treesitter-context

nvim-treesitter-context

MITJanetv1.0.0

A Neovim plugin that displays the current code context (function, class, etc.) at the top of the window using Tree-sitter.

GitHubGitHub
3.2k stars240 forks0 contributors

What is nvim-treesitter-context?

nvim-treesitter-context is a Neovim plugin that displays the current code context (such as function or class definitions) in a floating window at the top of the editor. It uses Tree-sitter for accurate syntax parsing to show relevant scope information, helping developers stay oriented while navigating large code files.

Target Audience

Neovim users who work with multiple programming languages and need better visibility of code structure, especially when dealing with long files or complex nested scopes.

Value Proposition

It provides a lightweight, language-agnostic way to see code context without switching buffers or scrolling, improving productivity and reducing cognitive load during development.

Overview

Show code context

Use Cases

Best For

  • Navigating large source code files with deep nesting
  • Maintaining orientation when working on functions or classes that span many lines
  • Quickly understanding the current scope in unfamiliar codebases
  • Enhancing Neovim's built-in navigation with visual context cues
  • Multi-language development where consistent context display is needed
  • Reducing scrolling when editing long methods or modules

Not Ideal For

  • Developers using Neovim versions below 0.9.0 who cannot or will not use the compatibility tag
  • Projects centered on languages not supported by Tree-sitter, such as SQL or Perl (listed as unsupported in the README)
  • Teams that prefer fully integrated, non-floating UI elements and find additional windows distracting or intrusive
  • Environments needing advanced context features like real-time editing within the context window or deep LSP integration

Pros & Cons

Pros

Wide Language Support

Works with over 100 programming languages via Tree-sitter parsers, including popular ones like Python and JavaScript, as listed in the README, making it versatile for multi-language projects.

Highly Customizable Display

Offers configurable colors, line numbers, separators, and window size, allowing users to match their editor theme and preferences, detailed in the Configuration and Appearance sections.

Lightweight and Performant

Designed as a minimal alternative to context.vim, focusing on simplicity and avoiding bloat, which aligns with its stated philosophy of being non-intrusive.

Useful Navigation Aid

Includes a mapping to jump upwards to parent context, enhancing code navigation without excessive scrolling, as shown in the README's jump-to-context example.

Cons

Parser Dependency and Instability

Relies on Tree-sitter parsers that are community-maintained; the README explicitly warns that support for specific languages can break as parsers update, leading to inconsistent functionality.

Setup and Dependency Overhead

Requires nvim-treesitter for non-default language parsers, adding an extra installation step and potential configuration complexity, which might deter users seeking plug-and-play solutions.

Limited Editor Compatibility

Only works with Neovim (version >= 0.9.0), excluding users of Vim or other editors, and even within Neovim, older versions need a compatibility tag, fragmenting support.

Open Source Alternative To

nvim-treesitter-context is an open-source alternative to the following products:

c
context.vim

context.vim is a Vim plugin that provides enhanced context-aware navigation and editing features within the Vim text editor.

Frequently Asked Questions

Quick Stats

Stars3,225
Forks240
Contributors0
Open Issues19
Last commit1 month ago
CreatedSince 2020

Tags

#treesitter#developer-tools#vim#syntax-highlighting#neovim-plugin#editor-enhancement#context-aware#code-navigation#neovim#vim-plugin

Built With

N
Neovim
T
Tree-sitter
L
Lua

Included in

Neovim20.6k
Auto-fetched 21 hours ago

Related Projects

nvim-autopairsnvim-autopairs

autopairs for neovim written in lua

Stars4,087
Forks140
Last commit16 days ago
zen-mode.nvimzen-mode.nvim

🧘 Distraction-free coding for Neovim

Stars2,154
Forks76
Last commit10 months ago
nvim-ts-autotagnvim-ts-autotag

Use treesitter to auto close and auto rename html tag

Stars2,118
Forks109
Last commit4 months ago
multicursor.nvimmulticursor.nvim

multiple cursors in neovim

Stars1,532
Forks14
Last commit5 months 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