From bd07b6ef705f3f8affa6c18b55a93190ad764351 Mon Sep 17 00:00:00 2001 From: caprain Date: Wed, 15 Apr 2026 20:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=8C=85=E8=A3=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/pack/configs/mini.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lua/pack/configs/mini.lua b/lua/pack/configs/mini.lua index 6a2da60..42102b1 100644 --- a/lua/pack/configs/mini.lua +++ b/lua/pack/configs/mini.lua @@ -12,14 +12,28 @@ vim.api.nvim_create_autocmd({ PackUtils.load(P, function() require('mini.surround').setup { mappings = { - add = 's', -- Add surrounding - delete = 'sd', -- Delete surrounding - find = 'sf', -- Find surrounding (to the right) + add = 's', -- Add surrounding + delete = 'sd', -- Delete surrounding + find = 'sf', -- Find surrounding (to the right) find_left = 'sF', -- Find surrounding (to the left) highlight = 'sh', -- Highlight surrounding - replace = 'cs', -- Replace surrounding/change sround + replace = 'cs', -- Replace surrounding/change sround update_n_lines = 'sn', -- Update `n_lines` }, + custom_surroundings = { + b = { + input = { '%*%*().-()%*%*' }, + output = { left = '**', right = '**' } + }, + i = { + input = { '%*().-()%*' }, + output = { left = '*', right = '*' } + }, + c = { + input = { '`().-()`' }, + output = { left = '`', right = '`' } + } + } } end) end)