A smart and powerful commenting plugin for Neovim with treesitter support, dot repeat, motions, and hooks.
Comment.nvim is a Neovim plugin that provides smart commenting functionality, allowing users to toggle line and block comments efficiently. It solves the problem of cumbersome commenting in code by offering intuitive keybindings, support for motions, and integration with treesitter for language-aware commenting.
Neovim users, particularly developers who write code in multiple languages and want a fast, customizable commenting workflow within their editor.
Developers choose Comment.nvim for its native treesitter support, dot repeat capability, and extensive hook system, which together provide a more powerful and flexible commenting experience compared to basic Vim commenting plugins.
:brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses treesitter to detect comment strings accurately for embedded languages like in Vue or Markdown, reducing errors in multi-language files.
Supports repeating comment toggles with the . command, allowing efficient batch operations without remapping.
Works seamlessly with motions (e.g., gcw for words) and text-objects (e.g., gci{ for brackets), enabling precise commenting based on code structure.
Offers pre and post hooks for custom Lua functions, enabling advanced behaviors like integrating with nvim-ts-context-commentstring for JSX support.
Admits no native support for jsx/tsx files, requiring extra configuration with plugins like nvim-ts-context-commentstring, which adds complexity.
Has known limitations with invalid or unexpected comments in regions where multiple languages intersect, as noted in the README issues.
Keybinding issues can arise, as highlighted in GitHub issues, necessitating manual troubleshooting that might frustrate new users.