This commit is contained in:
2026-04-11 10:05:15 +02:00
parent 2a102a0ee1
commit 4488f8549a
7 changed files with 95 additions and 24 deletions

View File

@ -1,6 +1,27 @@
vim.pack.add({"https://github.com/nvim-mini/mini.surround"})
require('mini.surround').setup()
vim.pack.add({ "https://github.com/nvim-mini/mini.surround" })
require('mini.surround').setup({
mappings = {
add = 'ma', -- Add surrounding in Normal and Visual modes
delete = 'md', -- Delete surrounding
find = 'mf', -- Find surrounding (to the right)
find_left = 'mF', -- Find surrounding (to the left)
highlight = 'mh', -- Highlight surrounding
replace = 'mr', -- Replace surrounding
suffix_last = 'l', -- Suffix to search with "prev" method
suffix_next = 'n', -- Suffix to search with "next" method
},
-- To remove default spaces that are added by default
custom_surroundings = {
['('] = { input = { '%b()', '^.().*().$' }, output = { left = '(', right = ')' } },
['['] = { input = { '%b[]', '^.().*().$' }, output = { left = '[', right = ']' } },
['{'] = { input = { '%b{}', '^.().*().$' }, output = { left = '{', right = '}' } },
['<'] = { input = { '%b<>', '^.().*().$' }, output = { left = '<', right = '>' } },
},
})
-- Comments
vim.pack.add({"https://github.com/nvim-mini/mini.comment"})
vim.pack.add({ "https://github.com/nvim-mini/mini.comment" })
require('mini.comment').setup()