neovim-confs/lua/custom/plugins/editing.lua

27 lines
953 B
Lua

return {
{
'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)' },
},
init = function()
require('core.utils').load_mappings 'comment'
end,
config = function(_, opts)
vim.keymap.set('n', '<leader>c', function()
require('Comment.api').toggle.linewise.current()
end, { desc = '[T]oggle [C]omment' })
vim.keymap.set('v', '<leader>c', function()
require('Comment.api').toggle.linewise.current()
end, { desc = '[T]oggle [C]omment' })
require('Comment').setup(opts)
end,
},
}