Preview of BracketHighligheter's new wrapping feature.
I have always wanted a nice easy way to wrap selections with custom stuff. I just wanted for instance to select some text, and select a something to wrap it with: tags, brackets, compiler switches, other stuff.
ST2 does good with brackets, but so much with other stuff. So one of the things I wanted to do in BH2 was to add this kind of functionality. I wanted to be able to define starting selections, tabstops, and indent style if required.
As you can see, the first example wraps a function with a compiler switch in C. It has two tabstops, and it is blocked off when the wrapping occurs.
In the second example, we have some HTML code, that gets wrapped in a generic tag with two tabstops that both automatically get selected so you can change their name a the same time. Also it blocks off the content and indents it.
This can be applied to lots of stuff. Something I am starting find pretty useful.
Still have some stuff to work out on bracket swapping which might end up being a more simplified version of this. Swapping won't auto indent etc, it will just replace the brackets inline. So you could turn curly brackets to square, or turn an #if/#endif condition into a #if/#elseif/#endif leaving the conditions in tact. I might add tabstops and auto selections to swapping as well. I think once I update the swapping stuff, I will setup the branch. I didn't intend wrapping and swapping to turn into what it did...it just kind of did...so this will set me back a little. Wrapping is done, I just need to rewrite the swapping stuff.