From 5de8fc70da2c87d17ffc6585810a65adadaeb26c Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 16 Sep 2024 14:32:45 +0300 Subject: feat: updated nvim surround to not add the annoying whitespace --- .config/nvim/lua/custom/plugins/nvim-surround.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to '.config/nvim') diff --git a/.config/nvim/lua/custom/plugins/nvim-surround.lua b/.config/nvim/lua/custom/plugins/nvim-surround.lua index a0b35ca..73fea73 100644 --- a/.config/nvim/lua/custom/plugins/nvim-surround.lua +++ b/.config/nvim/lua/custom/plugins/nvim-surround.lua @@ -8,8 +8,11 @@ return { { 'cS', '(nvim-surround-change)' }, { 'dS', '(nvim-surround-delete)' }, { '(', '(nvim-surround-visual)(', mode = 'v' }, + { ')', '(nvim-surround-visual))', mode = 'v' }, { '{', '(nvim-surround-visual){', mode = 'v' }, + { '}', '(nvim-surround-visual)}', mode = 'v' }, { '[', '(nvim-surround-visual)[', mode = 'v' }, + { ']', '(nvim-surround-visual)]', mode = 'v' }, { '`', '(nvim-surround-visual)`', mode = 'v' }, { '"', '(nvim-surround-visual)"', mode = 'v' }, { "'", "(nvim-surround-visual)'", mode = 'v' }, @@ -28,5 +31,15 @@ return { change = false, change_line = false, }, + surrounds = { + ['('] = { add = { '(', ')' } }, + [')'] = { add = { '( ', ' )' } }, + ['{'] = { add = { '{', '}' } }, + ['}'] = { add = { '{ ', ' }' } }, + ['<'] = { add = { '<', '>' } }, + ['>'] = { add = { '< ', ' >' } }, + ['['] = { add = { '[', ']' } }, + [']'] = { add = { '[ ', ' ]' } }, + }, }, } -- cgit v1.3.1