58 lines
1.6 KiB
Lua
58 lines
1.6 KiB
Lua
-- Author : swytch
|
|
-- Created : Tuesday Oct. 12, 2021 19:07:36 CET
|
|
-- License : GPLv3
|
|
-- Description : Comment plugin config file
|
|
|
|
require("Comment").setup {
|
|
---Add a space b/w comment and the line
|
|
---@type boolean
|
|
padding = true,
|
|
|
|
---Lines to be ignored while comment/uncomment.
|
|
---Could be a regex string or a function that returns a regex string.
|
|
---Example: Use '^$' to ignore empty lines
|
|
---@type string|function
|
|
ignore = nil,
|
|
|
|
---Whether to create basic (operator-pending) and extra mappings for NORMAL/VISUAL mode
|
|
---@type table
|
|
mappings = {
|
|
---operator-pending mapping
|
|
---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}`
|
|
basic = true,
|
|
---extra mapping
|
|
---Includes `gco`, `gcO`, `gcA`
|
|
extra = true,
|
|
---extended mapping
|
|
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
|
|
extended = false,
|
|
},
|
|
|
|
---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
|
|
---@type table
|
|
toggler = {
|
|
---line-comment toggle
|
|
line = "<leader><Space>",
|
|
---block-comment toggle
|
|
block = "<leader>bb",
|
|
},
|
|
|
|
---LHS of line and block comment operator-mode mapping in NORMAL/VISUAL mode
|
|
---@type table
|
|
opleader = {
|
|
---line-comment opfunc mapping
|
|
line = "<leader>c",
|
|
---block-comment opfunc mapping
|
|
block = "<leader>b",
|
|
},
|
|
|
|
---Pre-hook, called before commenting the line
|
|
---@type function|nil
|
|
pre_hook = nil,
|
|
|
|
---Post-hook, called after commenting is done
|
|
---@type function|nil
|
|
post_hook = nil,
|
|
}
|
|
|