Search code examples
sublimetext3sublimetext-snippet

Sublime Text Editor snippet to remove parentheses


Sublime is able to add parentheses, brackets (curly and square), apostrophes, and quotes to highlighted text by default. I've tried but can't seem to find a way to have it remove those as well. What I'd like to be able to do is highlight some text that is surrounded by parentheses and have it remove those. Is there a good way to do that using snippets?

I suspect it can be done with use of allFollowingCharacter and allPrecedingCharacter but it seems those might be from a previous version of Sublime when those were in XML instead of the current JSON...?

Any help would be appreciated!


Solution

  • With surround you can do this. Install it via Package Control. (Package Control Installation)

    Open the command palette:

    CTRLSHIFTP on Linux and Windows,

    CMDSHIFTP on Mac.

    Search for Surround: delete surround and type in ( and Enter and you are done!

    enter image description here