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" }) require('mini.comment').setup()