intellij-rainbow-brackets

?Rainbow Brackets / Rainbow Parentheses for IntelliJ based IDEs

Github星跟踪图

Compatibility

IntelliJ IDEA, PhpStorm, WebStorm, PyCharm, RubyMine, AppCode, CLion, Gogland, DataGrip, Rider, MPS, Android Studio

Supported languages

Java, Scala, Clojure, Kotlin, Python, Haskell, Agda, Rust, JavaScript, TypeScript, Erlang, Go, Groovy, Ruby, Elixir, ObjectiveC, PHP, HTML, XML, SQL, Apex language, C#, Dart, ...

Author's choice

Rainbow Brackets + Material Theme UI(Oceanic theme) + Nyan Progress Bar + Fira Code (Font)

This plugin is being sponsored by CodeStream.

https://codestream.com

Discussing code is now as easy as highlighting a block and typing a comment right from your IDE. Take the pain out of code reviews and improve code quality. Try it free!

Development powered by JetBrains.

https://www.jetbrains.com/?from=IntelliJRainbowBrackets

Whichever technologies you use, there's a JetBrains tool to match.

Screenshots

  • with Java

  • with Scala

  • with Clojure

  • with Kotlin

  • with HTML/XML

  • Scope highlighting

The highlight effects will not remove after release the shortcuts, but press ESC key can do this. You could also config Press any key to remove the highlighting effect in setting page.

Ctrl + Button3(Windows & Linux) or Meta+ Button3(Mac):

NOTE: Button3 means "Secondary Click (click or tap with two fingers)" on Mac os, "Right click" for Windows or Linux.

Alt + Button3:

NOTE: Button3 means "Secondary Click (click or tap with two fingers)" on Mac os, "Right click" for Windows or Linux.

  • Rainbow indent guide lines

  • looking forward to your screenshots(PR welcome!)

Install

For Windows & Linux - File > Settings > Plugins > Marketplace > Search for "Rainbow Brackets" > Install Plugin > Restart IntelliJ IDEA

For Mac - IntelliJ IDEA > Preferences > Plugins > Marketplace > Search for "Rainbow Brackets" > Install Plugin > Restart IntelliJ IDEA

Install snapshot build

You can download the latest snapshot build from here, just click in the latest build and click the 'Artifacts' tab.(You must logged in via github)

Customize colors

Settings/Preferences > Editor > Color Scheme > Rainbow Brackets:

Customize colors

Want to config the number of colors?

Settings/Preferences > Other Settings > Rainbow Brackets > Number of colors: 10 or more

NOTE: There are 10 default colors for both light and dark theme, if your number is bigger than 10, you can config them in the config file.
Please follow the official guide:

  • Export a color scheme as XML
  • Edit the xml file, put ROUND_BRACKETS_RAINBOW_COLOR10 to ROUND_BRACKETS_RAINBOW_COLOR100 to match your number just like the default color scheme.
  • Import a color scheme

Config file path

If you want to customize the advanced configuration, you could edit the config file then restart your IDE.
Config file path in APP_CONFIG/rainbow_brackets.xml.

In MAC OS env maybe like ~/Library/Preferences/IntelliJIdea2020.1/options/rainbow_brackets.xml.

If you are using the ToolBox, then it will be like ~/Library/ApplicationSupport/JetBrains/IntelliJIdea2020.1/options/rainbow_brackets.xml

In Linux env maybe like ~/.IntelliJIdea/config/options/rainbow_brackets.xml.

In Windows env maybe like C:\Users\izhangzhihao\.IntelliJIdea2020.1\config\options\rainbow_brackets.xml.

HTML code in js

To enable rainbow brackets for HTML inside js code like this:

var html = '<div><div><div>Hello</div></div></div>';

This plugin will automatically override color scheme property "HTML_CODE" cause our rainbow color been covered by intellij built-in functionality.
You still could set <option name="rainbowifyHTMLInsideJS" value="false" /> in config file to disable just like Config brackets colors.

Kotlin function literal braces and arrow

To enable rainbow brackets for multiple level lambda Kotlin code like this:

event.throwable?.let { throwable ->
    IdeErrorsDialog.findPluginId(throwable)?.let { pluginId ->
        PluginManager.getPlugin(pluginId)?.let { ideaPluginDescriptor ->
            if (!ideaPluginDescriptor.isBundled) {
                bean.pluginName = ideaPluginDescriptor.name
                bean.pluginVersion = ideaPluginDescriptor.version
            }
        }
    }
}

This plugin will automatically override color scheme property "KOTLIN_FUNCTION_LITERAL_BRACES_AND_ARROW" cause our rainbow color is being covered by kotlin plugin built-in functionality.
You still could set <option name="rainbowifyKotlinFunctionLiteralBracesAndArrow" value="false" /> in config file to disable just like Config brackets colors.

Disable rainbow brackets for specific languages

If you want to disable rainbow brackets for javascript languages and java languages, you could set languageBlacklist property in config file just like:

<application>
  <component name="RainbowSettings">
    <option name="languageBlacklist">
      <array>
        <option value="java" />
        <option value="javascript" />
      </array>
    </option>
  </component>
</application>

NOTE: You can use name of language or extension of file name(The names should be lowercase).

Contribute

NOTE: To view the PSI tree and explore the internal structure of source code, you need to setup your IDE follow this.

  • gradle test
  • gradle runIde
  • gradle buildPlugin

Support Us

You can support us by the following actions:

  • Star this project on GitHub
  • Share this plugin with your friends/colleagues
  • Rate this plugin on JetBrains plugin repository
  • Make pull requests
  • Report bugs
  • Tell us your ideas
  • Become a sponsor by donating on Open Collective
  • Become a sponsor by donating with AliPay or WeChatPay

Backers

Thank you to all our backers! ❤️ [Become a backer]

Sponsors

Support this project by becoming a sponsor! ? Your logo will show up here with a link to your website. [Become a sponsor]
















Acknowledgements

Intellij-rainbow-brackets is heavily inspired by Rainbow Brackets for Visual Studio Code

主要指标

概览
名称与所有者izhangzhihao/intellij-rainbow-brackets
主编程语言Kotlin
编程语言Kotlin (语言数: 1)
平台
许可证GNU General Public License v3.0
所有者活动
创建于2017-10-04 01:51:17
推送于2025-06-06 15:53:37
最后一次提交
发布数97
最新版本名称latest (发布于 )
第一版名称1.0 (发布于 )
用户参与
星数4.6k
关注者数38
派生数219
提交数1.1k
已启用问题?
问题数2628
打开的问题数4
拉请求数89
打开的拉请求数0
关闭的拉请求数17
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?