Sublime Forum

ToggleQuotes

#1

A plugin which will toggle the string quoting style of your selected text.

Step 1: Select some text including the quotes, eg: “hello world”
Step 2: Hit the opposite quote, in this example, ’
Result: ‘hello world’

Obviously, it works for converting single-to-double quotes too.

As a bonus, it will automatically escape any quote marks which now need escaping, and unescape those which no longer need it.

Select: "It's \"awesome\"" Press: ' Result: 'It\'s "awesome"' Press: " Result: "It's \"awesome\""

It works with multiple selections, however, unless all the selections have the same original quoting style (eg: all single quoted, or all double quoted), you have to press the hotkey to activate it: Ctrl+’

Installation via Package Control
Code/bug reports/feature requests at: github.com/spadgos/sublime-ToggleQuotes

0 Likes

#2

I needed this!

Would it be hard to include converting brackets (() <-> ] <-> {}) too?

0 Likes

#3

You can try bracket highlighters here.

Seeing your request I added a quick plugin command for to change current bracket to {}, ], (), or <> via the quick panel. Bracket Highlighter has a simple plugin system for tapping into to finding brackets. Swap Brackets only works on single selections right now, but in the future it could be reworked to work on multi.

Bracket Highlighter also has quote swapping (scope based).

**Edit: ** Now supports multi-select for bracket swapping

0 Likes

#4

This analog surround for VIM? :stuck_out_tongue:

0 Likes

#5

@Gordio: could you explain that?

0 Likes