Closed marcelarie closed 2 years ago
It would be even nicer if the user could add custom pairs and the "auto closing" feed from those pairs.
For example:
delimiters = {
pairs = {
["("] = { "( ", " )" },
[")"] = { "(", ")" },
["<custom>"] = { "<custom>", "</custom>" },
},
-- ...
of course, HTML tags can be automatically matched with all the cases that use <.*>
, it is just an example.
I just realized there is a "t" option for HTML tags 😅
Checklist
:h nvim-surround
to see if there might be any relevant information there?Describe the solution you'd like Using
Si
on visual mode gives the option to add a left and a right pair. This is cool but not useful for all the cases, sometime I just want to add the first pair, so the second closes automatically, like for example with HTML tags. Using the defaultS
surround, I can only write 1 character.I think the completion of the first pair should "finish" once the user presses enter to confirm the pair. For example:
When pressing
S
on visual mode:Then the right pair will be automatically closed with
</html>
.Additional context
https://user-images.githubusercontent.com/62728887/178730409-dfb77456-056e-4ffe-bd94-c6e03e82c431.mov