Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Neovim
  3. nvim-comment-frame

nvim-comment-frame

MITLua

A Neovim plugin that creates language-aware comment frames using Tree-sitter for automatic syntax detection.

GitHubGitHub
101 stars2 forks0 contributors

What is nvim-comment-frame?

nvim-comment-frame is a Neovim plugin that generates decorative comment blocks in code files. It automatically detects the programming language using Tree-sitter and creates properly formatted comment frames with customizable borders and indentation. This helps developers visually separate code sections and improve documentation readability.

Target Audience

Neovim users who write code in multiple languages and want to enhance their commenting style with automated, language-aware formatting.

Value Proposition

It eliminates manual effort in creating consistent comment blocks across different file types, with intelligent syntax detection and flexible configuration options for personalized workflows.

Overview

Detects the language using treesitter and adds a comment block

Use Cases

Best For

  • Adding decorative section headers in code documentation
  • Creating visually distinct comment blocks in multi-language projects
  • Automating comment formatting with language-specific syntax
  • Improving code readability with framed comments
  • Customizing comment styles per programming language
  • Quickly inserting formatted comments via keybindings

Not Ideal For

  • Projects that enforce minimalistic, plain comment styles without decorative elements
  • Teams requiring automated API documentation generation from comments (e.g., with Doxygen or JSDoc)
  • Neovim users without Tree-sitter installed or configured, as language detection depends on it

Pros & Cons

Pros

Intelligent Language Detection

Uses Tree-sitter to automatically identify file types and apply correct comment syntax, as demonstrated in the README with examples for JavaScript, Bash, and Lua.

Automatic Indentation

Respects current line indentation and tab/space settings via the auto_indent option, ensuring comment frames align properly within code blocks, as explained in the auto indent section.

Customizable Borders

Allows per-language configuration of frame width, fill characters, and start/end strings, detailed in the setup examples for languages like Lua with star-filled borders.

Flexible Keymaps

Provides default keybindings (<leader>cf and <leader>cm) and easy customization through the setup function, supporting both single and multiline comments as shown in the keymaps section.

Cons

Tree-sitter Dependency

Relies on nvim-treesitter for language detection; if Tree-sitter is missing or fails, the plugin may not work correctly, requiring manual configuration or additional setup.

Decorative Focus Only

Primarily designed for creating decorative comment frames, not for general commenting or inline documentation, which limits its utility for broader documentation needs beyond visual separation.

Per-Language Setup Overhead

While customizable, setting up language-specific configurations can be tedious, especially for multi-language projects, as each language requires individual adjustments in the setup, as noted in the configuration examples.

Frequently Asked Questions

Quick Stats

Stars101
Forks2
Contributors0
Open Issues1
Last commit11 months ago
CreatedSince 2021

Tags

#treesitter#developer-tools#syntax-highlighting#neovim-plugin#plugin#editor-enhancement#vim-scripting#comments#code-formatting#neovim#lua#nvim

Built With

N
Neovim
T
Tree-sitter
L
Lua

Included in

Neovim20.6k
Auto-fetched 1 day ago

Related Projects

Comment.nvimComment.nvim

:brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more

Stars4,658
Forks186
Last commit1 year ago
todo-comments.nvimtodo-comments.nvim

✅ Highlight, list and search todo comments in your projects

Stars4,183
Forks138
Last commit8 months ago
neogenneogen

A better annotation generator. Supports multiple languages and annotation conventions.

Stars1,656
Forks74
Last commit6 months ago
nvim-ts-context-commentstringnvim-ts-context-commentstring

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

Stars1,302
Forks48
Last commit3 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