Using (
in nvim.surround surrounds word with white space like so: ( word )
. )
have to be used instead. The following changes in the nvim.surround.lua
file overwrites this behaviour.
return {
{
"kylechui/nvim-surround",
-- tag = "*", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup {
surrounds = {
["("] = {
add = function() return { { "(" }, { ")" } } end,
},
["{"] = {
add = function() return { { "{" }, { "}" } } end,
},
["["] = {
add = function() return { { "[" }, { "]" } } end,
},
["<"] = {
add = function() return { { "<" }, { ">" } } end,
},
},
}
end,
},
}