From 91bb16aacf386da01452ba9ac063bc1622baccde Mon Sep 17 00:00:00 2001 From: hectron Date: Fri, 1 May 2026 20:11:44 +0000 Subject: [PATCH] feat(coding): Use Neovim's built in commenting `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: https://github.com/numToStr/Comment.nvim/pull/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! --- lazy-lock.json | 1 - lua/config/keymaps.lua | 5 ++--- lua/plugins/coding.lua | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 8ffaf0c..2dd8170 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,6 @@ { "Align": { "branch": "master", "commit": "787662fe90cd057942bc5b682fd70c87e1a9dd77" }, "CamelCaseMotion": { "branch": "master", "commit": "e69b0024f8f63db10c5d0df26d4920760755d454" }, - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "main", "commit": "07dcc188bc488b2dafa9324bd42088640bee3d19" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, "VimClojure": { "branch": "master", "commit": "2a17c249571395a7f45523d38cac6a9326ecf8f1" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index b7af38d..1680959 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,14 +1,13 @@ local map = vim.keymap.set -- Normal mode mapping for removing highlight from text search map("n", "nh", "nohls", { desc = "Removes text searching highlight" }) + -- clear search highlights with esc map({ "i", "n" }, "", "noh", { desc = "Escape and Clear hlsearch" }) + -- open lazy map("n", "l", "Lazy", { desc = "Lazy" }) --- Normal and visual mode mapping for commenting lines -map({ "n", "v" }, "cc", "normal gcc", { desc = "Comments the current or highlighted lines" }) - -- Remove trailing whitespace map("n", "cw", "%s/\\s\\+$//e", { desc = "Remove trailing whitespace" }) diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 17ab53a..f82ec75 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -9,11 +9,6 @@ return { enabled = false, -- Toggle this in neovim-dotfiles-personal to turn on autopairs event = "InsertEnter", }, - { - "numToStr/Comment.nvim", - event = LazyFileEvents, - opts = {}, - }, { "saghen/blink.cmp", version = "1.*",