Files
neovim-config/lua/taken/plugins/comment.lua
2024-11-17 18:21:12 +01:00

32 lines
922 B
Lua

--- @type LazyPluginSpec
return {
"numToStr/Comment.nvim",
dependencies = "JoosepAlviste/nvim-ts-context-commentstring",
keys = { "gcc", "gbc", { "gc", mode = "v" }, { "gb", mode = "v" }, "gcO", "gco", "gcA" },
config = function()
local comment = require("Comment")
comment.setup({
padding = true,
sticky = true,
toggler = {
line = "gcc",
block = "gbc",
},
opleader = {
line = "gc",
block = "gb",
},
extra = {
above = "gcO",
below = "gco",
eol = "gcA",
},
mappings = {
basic = true,
extra = true,
},
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
})
end,
}