Skip to content

feat(coding): Use Neovim's built in commenting#16

Merged
hectron merged 1 commit into
mainfrom
feat/use-built-in-commenting
May 20, 2026
Merged

feat(coding): Use Neovim's built in commenting#16
hectron merged 1 commit into
mainfrom
feat/use-built-in-commenting

Conversation

@hectron

@hectron hectron commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Comment.nvim stopped active development about 2 years ago. The
implementation for commenting relied on an old API that hasn't yet been
patched.

Almost two months ago, this was opened to handle it but there hasn't
been any progress: numToStr/Comment.nvim#518

Since then, Neovim has supported commenting using identical keymaps
powered by Treesitter and commentstring (:h commenting and :h commentstring).

Let's just use native Neovim functionality!

`Comment.nvim` stopped active development about 2 years ago. The
implementation for commenting relied on an old API that hasn't yet been
patched.

Almost two months ago, this was opened to handle it but there hasn't
been any progress: numToStr/Comment.nvim#518

Since then, Neovim has supported commenting using identical keymaps
powered by Treesitter and commentstring (`:h commenting` and `:h
commentstring`).

Let's just use native Neovim functionality!
Comment thread lua/config/keymaps.lua
map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })

-- Normal and visual mode mapping for commenting lines
map({ "n", "v" }, "<Leader>cc", "<cmd>normal gcc<cr>", { desc = "Comments the current or highlighted lines" })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this just removing the remap? if we want \cc to still comment things I think we can leave this in, getting rid of comment.nvim should be enough

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\cc comments out code without this remap!

@hectron hectron merged commit a3ca8b7 into main May 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants