comments: use neovim native commenting (#2861)
* comments: use neovim native commenting * Comment mapping : remap to gc/gcc --------- Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
This commit is contained in:
parent
722b42f2c9
commit
f9ed3a79db
@ -44,16 +44,8 @@ map("n", "<leader>x", function()
|
||||
end, { desc = "buffer close" })
|
||||
|
||||
-- Comment
|
||||
map("n", "<leader>/", function()
|
||||
require("Comment.api").toggle.linewise.current()
|
||||
end, { desc = "comment toggle" })
|
||||
|
||||
map(
|
||||
"v",
|
||||
"<leader>/",
|
||||
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
|
||||
{ desc = "comment toggle" }
|
||||
)
|
||||
map("n", "<leader>/", "gcc", { desc = "comment toggle", remap = true })
|
||||
map("v", "<leader>/", "gc", { desc = "comment toggle", remap = true })
|
||||
|
||||
-- nvimtree
|
||||
map("n", "<C-n>", "<cmd>NvimTreeToggle<CR>", { desc = "nvimtree toggle window" })
|
||||
|
@ -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" },
|
||||
|
Loading…
Reference in New Issue
Block a user