This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.config/nvim/lua/plugin/comment.lua

58 lines
1.6 KiB
Lua
Raw Normal View History

2021-10-12 19:10:20 +02:00
-- 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,
2021-10-17 14:41:33 +02:00
---extra mapping
---Includes `gco`, `gcO`, `gcA`
extra = true,
2021-10-12 19:10:20 +02:00
---extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
2021-10-17 14:41:33 +02:00
extended = false,
2021-10-12 19:10:20 +02:00
},
---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode
---@type table
toggler = {
---line-comment toggle
2021-10-17 14:41:33 +02:00
line = "<leader><Space>",
2021-10-12 19:10:20 +02:00
---block-comment toggle
2021-10-17 14:41:33 +02:00
block = "<leader>bb",
2021-10-12 19:10:20 +02:00
},
---LHS of line and block comment operator-mode mapping in NORMAL/VISUAL mode
---@type table
opleader = {
---line-comment opfunc mapping
2021-10-17 14:41:33 +02:00
line = "<leader>c",
2021-10-12 19:10:20 +02:00
---block-comment opfunc mapping
2021-10-17 14:41:33 +02:00
block = "<leader>b",
2021-10-12 19:10:20 +02:00
},
---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,
}