简体   繁体   中英

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!

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

Open the command palette:

CTRL SHIFT P on Linux and Windows,

CMD SHIFT P on Mac.

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

在此输入图像描述

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM