5

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!

2 Answers 2

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

Looks great. I'll look into this, and then see about setting up shortcut keys for it. Thanks!
4

I'm surprised this question isn't searched more regularly!

BracketHighlighter is an excellent utility that includes convenient deleting of parenthesis. To cut to the chase, install BracketHighlighter and set bh_remove_brackets to whatever shortcut you'd like to be able to delete parentheses. Search up bh_remove_brackets in the example sublime keymap to see an example!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.