33

So, vim users have https://github.com/kien/rainbow_parentheses.vim

Emacs users have http://www.emacswiki.org/emacs/RainbowDelimiters

Is there something similar for users of Sublime Text (2 or 3?)

I already have bracket highlighter, which lets me highlight the innermost brackets, but I edit a lot of complex SQL in sublime text 3, and sometimes lose track of my parentheses. Can you edit the configuration files for this to match the behavior of the others?

Bracketeer allows you to perform operations on brackets, but I'd like to just see them in colors.

As requested, some example sql:

Select
  name,
  sum(cost) as total_cost,
  count(*) as count
from
  personnel p,
  order o
where
  p.prsnl_id = o.prsnl_id
  and o.prsnl_id in (
    Select prsnl_id 
    from
    organization_personnel_relation
    where
    org_id in (Select org_id from organization_personnel_relation where prsnl_id = (Select prsnl_id from personnel where prsnl_name = 'test')))
  and cost is not null
group by name
order by total_cost desc
limit 50;

I know it's not super deep nesting, but there are cases where I do see very deep nesting of parentheses, and I still would like to learn a lisp one day.

3
  • 1
    Can you post some example SQL for testing? Also, are you using the built-in SQL syntax highlighting, or did you install a specialized package? I think it's possible with your color scheme (I do it with different levels of JSON, for instance) but I need to check the scopes first.
    – MattDMo
    Commented Sep 9, 2013 at 22:59
  • @MattDMo I am using a color modified version of the neon-theme that you can install using package control. If I can get nested braces/brackets/parentheses to come out a different color just by editing my theme, I will. I also have the JSON level formatting that you referenced.
    – Caleb
    Commented Sep 10, 2013 at 18:57
  • thanks for using my theme :) Just out of curiosity, what did you change and why? I'm trying to get as much feedback as possible, just open an issue and let me know.
    – MattDMo
    Commented Sep 12, 2013 at 18:56

3 Answers 3

2

Here is another similar package:

This plugin [RainbowBrackets] I wrote for SublimeText is to highlight brackets. It matches brackets you have added for the file type, then gives brackets at different levels different colors, in the cycle of the number of colors. colors are gave in the settings file, by default, there are 7 type of colors.

(github repository)

1

This isn't ideal, but you can make sure you have the following settings:

"match_brackets": true,
"match_brackets_angle": true,
"match_brackets_braces": true,
"match_brackets_content": true,
"match_brackets_square": true,

And then when you are in a paren or bracket, the corresponding one will be highlighted.

enter image description here

2
  • This is what I already have from bracket highlighter, but I appreciate you posting on it. If you look up vim rainbow parens on google, you can see a better example of what I'm talking about.
    – Caleb
    Commented Sep 10, 2013 at 18:56
  • Yeah, I haven't seen anything like that, thus why my example isn't ideal. Would be very interested to see this implemented in sublime
    – wesbos
    Commented Sep 10, 2013 at 19:34
1

This package seems like what you were looking for:

Rainbowth is a Sublime Text 3 plugin that automagically highlights matching parentheses, brackets, and curly braces in source code. While the name does imply a certain sequence of colors, the palette used to paint them is entirely configurable

(github repository)

Not the answer you're looking for? Browse other questions tagged or ask your own question.