Home Download Buy Blog Forum Support

An attempt at describing Bracketeer.

An attempt at describing Bracketeer.

Postby colinta on Tue Feb 07, 2012 5:45 pm

There were a few quirky pasting and indenting issues that I was getting frustrated with, and I hadn't really figured out the userecho bug report system (still haven't — I wish it had "real" bug/issue/feature tracking abilities).

So I wrote bracketeer, and now I continue to like it since, well for one it works, but more because it lets me tweak with bracket-typing behavior. For instance, I can hit
Code: Select all
ctrl+',ctrl+'
to start writing a python doc comment. Or that typing a ' inside "" does not produce double 's, just a single apostrophe.

I've also tried to figure out good indent, unindent behavior when typing {,}. At this point I think Jon has probably done a better job, but I haven't disabled my plugin to find out, hopefully some discussion here will shine some light on that.

I didn't just recreate the wheel, I also added a few bracket-manipulation commands. Here is the entire list of commands:

  • bracketeer_indent: I have a particular way I like text to be indented, involving *not* indenting the last line my cursor is on, ignoring the first unless it's at the first col, not indenting blank lines, and not indenting <?php / ?> tags if they are at the beginning of the line. If you don't like it, don't use it ;-)
  • bracketeer_select: I think you'll like this one. Selects inside the current braces, then selects the braces themselves, and so on until the outermost brackets are selected. Useful for grabbing blocks of code in C-style languages, or argument lists in python.
  • bracketeer: the namesake command inserts braces or quotes and is configurable to some degree. Again, you might no like it, but if you do like it, you might love it!
  • bracketeer_goto: This one is neat, especially when passed {"goto":"both"}. It will place two cursors: one to the right of the left brace, and one to the right of the right brace. Matches curly braces only. In this way, it is really easy to remove the curly braces around one liners, if you're cleaning up if..else if...else blocks.

The best source of documentation is my Example.sublime-keymap file.

Did you know, the Example.sublime-keymap file is generated based on my Default (OSX).sublime-keymap file? It's the same with all my plugins. So anytime I fix something or add something, it gets "documented" in that file! Neat.
colinta
 
Posts: 15
Joined: Wed Dec 21, 2011 9:43 pm

Re: An attempt at describing Bracketeer.

Postby spadgos on Wed Feb 08, 2012 8:44 am

Hey, do you have a link to the repo? :)
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: An attempt at describing Bracketeer.

Postby colinta on Wed Feb 08, 2012 4:09 pm

How embarrassing! Of course:

https://github.com/colinta/SublimeBracketeer

And available on Package Control ("Bracketeer")
colinta
 
Posts: 15
Joined: Wed Dec 21, 2011 9:43 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 3 guests