Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text Rainbow Parentheses

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.

like image 676
Caleb Avatar asked Sep 09 '13 21:09

Caleb


2 Answers

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

like image 85
wesbos Avatar answered Nov 17 '22 21:11

wesbos


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)

like image 26
Scott Centoni Avatar answered Nov 17 '22 20:11

Scott Centoni