diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 2019ff5..c55bd40 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -124,8 +124,8 @@ end M.comment = function() local m = plugin_maps.comment.toggle - map("n", m, ":CommentToggle ") - map("v", m, ":CommentToggle ") + map("n", m, ":lua require('Comment.api').toggle()") + map("v", m, ":lua require('Comment.api').gc(vim.fn.visualmode())") end M.dashboard = function() diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index df25ef5..d9bb64c 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -62,7 +62,7 @@ M.colorizer = function() end M.comment = function() - local present, nvim_comment = pcall(require, "nvim_comment") + local present, nvim_comment = pcall(require, "Comment") if present then nvim_comment.setup() end diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index bc1004a..a622e29 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -191,11 +191,12 @@ return packer.startup(function() } use { - "terrortylor/nvim-comment", + "numToStr/Comment.nvim", disable = not plugin_settings.status.comment, - cmd = "CommentToggle", + module = "Comment", config = override_req("nvim_comment", "(plugins.configs.others).comment()"), setup = function() + require("core.utils").packer_lazy_load "Comment.nvim" require("core.mappings").comment() end, }