plugin: Use Comment.nvim | Resolve #646 & #626

This commit is contained in:
Akianonymus 2021-12-11 22:23:09 +05:30 committed by siduck
parent 16d035c031
commit d2db2cc1cd
3 changed files with 6 additions and 5 deletions

View file

@ -124,8 +124,8 @@ end
M.comment = function()
local m = plugin_maps.comment.toggle
map("n", m, ":CommentToggle <CR>")
map("v", m, ":CommentToggle <CR>")
map("n", m, ":lua require('Comment.api').toggle()<CR>")
map("v", m, ":lua require('Comment.api').gc(vim.fn.visualmode())<CR>")
end
M.dashboard = function()

View file

@ -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

View file

@ -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,
}