From f9ed3a79dbe956cdbd866b0d3f3b2650c61d81ee Mon Sep 17 00:00:00 2001 From: Hanxx Date: Sat, 1 Jun 2024 09:38:32 +0800 Subject: [PATCH] comments: use neovim native commenting (#2861) * comments: use neovim native commenting * Comment mapping : remap to gc/gcc --------- Co-authored-by: Sidhanth Rathod --- lua/nvchad/mappings.lua | 12 ++---------- lua/nvchad/plugins/init.lua | 15 --------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/lua/nvchad/mappings.lua b/lua/nvchad/mappings.lua index 494a98a..8c2916f 100644 --- a/lua/nvchad/mappings.lua +++ b/lua/nvchad/mappings.lua @@ -44,16 +44,8 @@ map("n", "x", function() end, { desc = "buffer close" }) -- Comment -map("n", "/", function() - require("Comment.api").toggle.linewise.current() -end, { desc = "comment toggle" }) - -map( - "v", - "/", - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - { desc = "comment toggle" } -) +map("n", "/", "gcc", { desc = "comment toggle", remap = true }) +map("v", "/", "gc", { desc = "comment toggle", remap = true }) -- nvimtree map("n", "", "NvimTreeToggle", { desc = "nvimtree toggle window" }) diff --git a/lua/nvchad/plugins/init.lua b/lua/nvchad/plugins/init.lua index 516ddca..bac177e 100644 --- a/lua/nvchad/plugins/init.lua +++ b/lua/nvchad/plugins/init.lua @@ -129,21 +129,6 @@ return { end, }, - { - "numToStr/Comment.nvim", - keys = { - { "gcc", mode = "n", desc = "comment toggle current line" }, - { "gc", mode = { "n", "o" }, desc = "comment toggle linewise" }, - { "gc", mode = "x", desc = "comment toggle linewise (visual)" }, - { "gbc", mode = "n", desc = "comment toggle current block" }, - { "gb", mode = { "n", "o" }, desc = "comment toggle blockwise" }, - { "gb", mode = "x", desc = "comment toggle blockwise (visual)" }, - }, - config = function(_, opts) - require("Comment").setup(opts) - end, - }, - { "nvim-telescope/telescope.nvim", dependencies = { "nvim-treesitter/nvim-treesitter" },