Commentless.nvim
Hide comments, focus on the code flow, and reveal them if needed 🧘
Install / Use
/learn @soemre/Commentless.nvimREADME
🧘 commentless.nvim
Hide comments, focus on the code flow, and reveal them if needed.
This plugin lets you fold all comments to better visualize your code’s logic, and unfold them whenever needed.
<div align="center"> <img src="https://i.imgur.com/32JkGlQ.gif" alt="commentless.nvim usage" width="90%"> </div>📦 Installation
Use your favorite plugin manager to install it, and then run
require("soemre/commentless.nvim").setup({}) to start it up.
Also, check out the Some Recommendations for Global Folding Behavior section.
lazy.nvim
The setup call is handled internally by lazy.nvim.
{
"soemre/commentless.nvim",
cmd = "Commentless",
keys = {
{
"<leader>/",
function()
require("commentless").toggle()
end,
desc = "Toggle Comments",
},
},
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
opts = {
-- Customize Configuration
},
}
🚀 Usage
To get started, bind keys to the public API or run :Commentless <args> directly.
Example
vim.keymap.set("n", "<leader>/", function()
require("commentless").toggle()
end)
🛠️ Configuration
Check :help commentless for full documentation.
Default Configuration
{
hide_following_blank_lines = true,
foldtext = function(folded_count)
return "(" .. folded_count .. " comments)"
end,
}
Some Recommendations for Global Folding Behavior
vim.opt.foldminlines = 0 -- Allow folding/hiding single lines
vim.opt.fillchars = "fold: " -- Remove the trailing dots
ⓘ FAQ
Why isn't it working with some file types?
To determine whether something is a comment, it uses tree-sitter. Therefore,
you need to have tree-sitter parsers installed for the file types (languages)
you plan to use. You can install them using :TSInstall <language_to_install>
or via the ensure_installed option in tree-sitter's setup parameters.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
