# JoosepAlviste/nvim-ts-context-commentstring

Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.

Repository: https://github.com/JoosepAlviste/nvim-ts-context-commentstring
Canonical: https://ross.abutalabs.com/products/nvim-ts-context-commentstring
Language: Lua
License: MIT
License Family: permissive
Topics: treesitter, neovim-plugin, lua, tree-sitter, neovim, plugin
Last push: 2026-04-04T17:55:53+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 75, release rhythm 35, longevity 100
- inputs: {"age_days": 2016, "days_push": 151, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1303, forks 48 (observed 2026-08-28T04:04:18.402285+00:00)

## What it is
A Neovim plugin that sets the commentstring option dynamically based on the cursor location using tree-sitter queries. It handles files with embedded languages, such as Vue files with multiple sections, and integrates with commenting plugins like Comment.nvim.

## Use cases
- comment code correctly in Vue files with mixed JS and HTML sections
- set commentstring based on cursor location in embedded languages
- make vim-commentary work with JSX and embedded languages
- support tree-sitter-aware commenting in Neovim
- use different comment styles within a single file

## When to avoid
- you only edit single-language files where the default commentstring works
- you don't use tree-sitter parsers in Neovim
- you want a plugin that adds commenting mappings itself

## Facets
- artifact type: plugin
- maturity: active
- function: editor, plugin-system, parser, developer-tools
- domain: text-editors, developer-tools, parsers
- platform: editor-plugin, lua, cli
- tags: treesitter, neovim-plugin, commentstring, embedded-languages, code-commenting, neovim

## Member repositories
- JoosepAlviste/nvim-ts-context-commentstring (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:18.402285+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:51:10.648264+00:00, confidence not recorded.
  - readme: https://github.com/JoosepAlviste/nvim-ts-context-commentstring (fetched 2026-08-28T04:04:18.402285+00:00, sha 5da6a5fc049a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
