Is there really no "Rainbow colored brackets" package?


#1

I use this in vim, and the bracket-matcher package is no substitute!
Help!


#2

This would be a good excuse for you to learn how to write packages. (grin) May I suggest a pull-request to the bracket-matcher package?


#3

Touche. If there really isn’t one, I’ll look at it this weekend.


#4

It’s hard to know the capabilities of every single package available, since there are over 2,400 of them now. But I don’t see anything that seems to say it has that capability, do you?


#5

No, but of course to me this functionality is so basic and obvious that it’s completely stupefying that Atom existed for five minutes without anyone making this package, let alone what… five years?

But then I suffer from the horrible and devastating disease “bracket blindness”…


#6

Wow. I think you have broken the record for exaggeration. How many editors support this? I’ve used a lot of editors over many years and I’ve never heard of it.


#7

You may have missed my tone there.


#8

As I said I knew you were exaggerating and I assume “for effect”. I didn’t mean to berate your message. I was seriously asking what editors you have seen it on.

BTW, if it is the feature I am imagining where matching brackets have the same color, then that sounds awesome. If anyone writes it I would definitely use it. If I had the time, I would definitely write it. It would be easy for me.

I have a lot of experience writing packages (21). I would be happy to hold someone’s hand and help write this. My main problem is supporting the package. I am in the process of dropping support for a lot of packages because I don’t have the time. I never dreamed how often they would break.

It would be simple. Find the matches in the text buffer and create a marker for every bracket, paren, brace. The API has everything needed.


#9

Sublime Text, VIM and Emacs. I originally used it in VIM, but I know there’s a sublime text plugin.

I’ll look at the bracket matcher thing this weekend. Honestly, I think a simple toggle in BM is far easier than making a separate plugin. I can’t think of a simple use case where someone would want the rainbow feature without bracket matcher.

It is the feature you’re imagining. The idea behind this came from Lisp, or possibly Clojure, where parens are so frequent you end up having to remap your keyboard so the shift key (and your little finger) survive. (Or so I imagine, I couldn’t imagine using the language myself. Here’s a screenshot of the VIM plugin I use:

Rainbow


#10

Oh, I didn’t realize they were permanently colored. I couldn’t possibly live with all that clutter. I want it to just color them when the cursor is between them. All surrounding pairs would be colored.


#11

I suppose it could be triggered on and off with a shortcut, but that’s really just details.


#12

I would love something that coloured the corresponding brackets — like bracket matcher but whenever the cursor is between the brackets.

And/or perhaps coloured the background between the brackets — that would be even cooler.


#13

I’ve looked at bracket-matcher, but there’s no way I’m going to be able to grok the API and the plugin in time to get this done over the weekend, so if anyone else has the time, feel free to do it.


#14

There are emacs packages for both approaches: http://www.emacswiki.org/emacs/ParenthesesAppearance


#15

@jrattray13 just released swackets that does this


#16

I implemented the follow cursor approach: https://atom.io/packages/rainbow-delimiters it only highlights brackets around the cursor.


#17

This is possibly better than regular rainbow parens. Thank you and good work!


#18

My take on it: https://atom.io/packages/atom-brackets-glow. Simple and effective.


#19

This is super helpful. I’m starting with Clojure and was contemplating learning Emacs just to have this feature!