Home Download Buy Blog Forum Support

BracketHighlighter 2 Moar Bracket Powa!

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby SeanWcom on Mon Oct 15, 2012 3:05 pm

Love that you'll allow custom bracketing definition... that's killer. Count me in for testing!
Multiple selections... one of my favorite ST2 features. View some noob-friendly screen casts here.
SeanWcom
 
Posts: 101
Joined: Wed Aug 03, 2011 1:31 am
Location: Georgia

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Mon Oct 15, 2012 3:57 pm

SeanWcom wrote:Love that you'll allow custom bracketing definition... that's killer. Count me in for testing!


@SeanWcom Thanks!
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 17, 2012 3:31 pm

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.

BH_WRAPPING.png
BH_WRAPPING.png (24.62 KiB) Viewed 1606 times


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.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby Eduan on Wed Oct 17, 2012 3:59 pm

That is totally awesome facelessuser!

I suppose you are going to allow us to customize these automatic bracketing correct?
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 17, 2012 4:10 pm

Eduan wrote:That is totally awesome facelessuser!

I suppose you are going to allow us to customize these automatic bracketing correct?

Of course. The last thing I want to do is have people making requests to me for doing this in every language :D.

So everything is generalized. Here is an example configuration (keep in mind, syntax is subject to change before the official release):
Code: Select all
        {
            "enabled": true, "language_list": ["HTML", "HTML 5", "XML", "PHP", "ColdFusion", "ColdFusionCFC"], "language_filter": "whitelist", "entries": [
                {"name": "HTML/XML Tag", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"]},
                {"name": "HTML/XML Tag - Block", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"], "insert_style": "block"},
                {"name": "HTML/XML Tag - Block Indent", "brackets": ["<${BH_SEL:NAME}>", "</${BH_SEL:NAME}>"], "insert_style": "indent_block"}
            ]
        },


Due to swapping behavior being different than wrapping, they will have separate definitions. I am not sure if they will exist in the same settings file or have a separate swap settings file. I really am looking at swapping and wrapping as separate sub-plugins. I toyed with finding a way to make the same definition work for both, but it just got ugly. Wrapping can surround text with anything. Swapping is specifically swapping out the brackets that BH highlights.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby facelessuser on Wed Oct 17, 2012 4:14 pm

Usage currently is select text, invoke wrapping shortcut, and use fuzzy panel to pick what you want to wrap with. So it won't be automatic, but still pretty quick compared to how it was before.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby Eduan on Wed Oct 17, 2012 4:15 pm

OK, well be sure that I'm gonna check them out, even though I don't know Python, I guess I'm gonna have to learn. ;)

Anyway, looking forward to it. :)

Edit for new post: That is even more awesome! :P
Last edited by Eduan on Thu Oct 25, 2012 5:42 pm, edited 1 time in total.
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Re: BracketHighlighter 2 Moar Bracket Powa!

Postby twoohfour on Thu Oct 25, 2012 5:22 pm

Can't wait for this
twoohfour
 
Posts: 3
Joined: Thu Jun 21, 2012 5:20 pm

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot], jfcherng and 11 guests