Skip to content

Commit 9946be8

Browse files
committed
adjust mini paris to prevent closing pair at the beginning of text
1 parent ed9babc commit 9946be8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.config/nvim/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ require('lazy').setup({
6767
require('mini.pairs').setup({
6868
modes = { insert = true, command = false, terminal = false },
6969
mappings = {
70-
['"'] = { action = 'open', pair = '""', neigh_pattern = '[^%a\\].' },
71-
["'"] = { action = 'open', pair = "''", neigh_pattern = '[^%a\\].' }
70+
['('] = { action = 'open', pair = '()', neigh_pattern = '.[^%w|^\\|^/]' },
71+
['['] = { action = 'open', pair = '[]', neigh_pattern = '.[^%w|^\\|^/]' },
72+
['{'] = { action = 'open', pair = '{}', neigh_pattern = '.[^%w|^\\|^/]' },
73+
['"'] = { action = 'closeopen', pair = '""', neigh_pattern = '.[^%w|^\\|^/]', register = { cr = false } },
74+
["'"] = { action = 'closeopen', pair = "''", neigh_pattern = '.[^%w|^\\|^/]', register = { cr = false } },
7275
}
7376
})
7477
end

0 commit comments

Comments
 (0)