Nested Brackets Colorer

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
Aug 27, 2018
4 787
Coloring nested round (), angled <> and square [] brackets starting from the second level at next languages:
- Java (built-in Java plugin required)
- Kotlin (built-in Kotlin plugin required)
- Flex (Grammar-Kit plugin required)
- PHP and JavaScript/TypeScript (tested with built-in PHP and JS plugins at PhpStorm)
- Python (tested with PyCharm)
- Scala (Scala plugin required)

Download plugin

Recent change notes

0.3.1 Angled brackets <> support added for Java/Kotlin
0.3.0 Scala support added
0.2.1 Colors (and styles) customisation available at Settings -> Editor -> Color Scheme -> Nested Brackets Colorer
0.2.0 Python support added
0.1.0 PHP and JavaScript/TypeScript support added
0.0.2 Change colors to less "acidic"
0.0.1 Initial release

General usage instructions

Inspired by Rainbow Brackets plugin.
Main distinguishing features:
- Only round () and square [] brackets colored as they need more visual separation at Java and Kotlin. Curly brackets {} in Java/Kotlin usually separated by code formatting.
- The color represents bracket level:
Round brackets: default color for the first level, green for the second, blue for the third and white for the fourth level, then repeat from green color.
Square brackets: default color for the first level, purple for the second and white for the third level, then repeat from purple.
- No warm colors (yellow and red) used as they usually used to highlight warnings and errors in the code.
- Only same type of brackets colored, no mess with other types.
- Coloring starts from the second level to make visual highlighting of nested brackets only and do not make code looks too motley.
- Particular language lexer types are used to recognize brackets. So no needs to reinvent the wheel and deals with corner cases like ("("). As the downside, it's not as easy to add support for the new language.
If other language support needed, let me know in comments below. Ideally, if you provide name/link of the plugin that implements that language lexer at IntelliJ platform.