1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-01-12 18:42:45 +01:00
IntelliJ Platform plugin that colors bracket pairs and indentation.
Go to file
2019-01-12 15:58:20 +08:00
.circleci Bump versions & fix gradle build with version 4.8 2018-06-16 12:46:27 +08:00
gradle/wrapper Upgrade gradle to 4.6 2018-03-04 22:03:36 +08:00
screenshots Add screenshots 2018-09-27 14:17:30 +08:00
src Replace the usage of ApplicationComponent using BaseComponent cause is deprecated in 183.4588.61 2019-01-12 15:58:20 +08:00
.gitignore Update git ignore 2018-01-22 17:43:55 +08:00
.travis.yml Do NOT download source in travis CI as well 2018-04-06 15:27:39 +08:00
build.gradle Exclude ui/form code in test coverage 2018-09-26 17:25:22 +08:00
gradle.properties 5.13 2018-12-17 19:50:37 +08:00
gradlew Initial commit 2017-10-04 12:09:51 +08:00
gradlew.bat Initial commit 2017-10-04 12:09:51 +08:00
ISSUE_TEMPLATE.md [ci skip] Update ISSUE_TEMPLATE.md 2018-04-16 16:39:40 +08:00
LICENSE Add LICENSE 2018-02-20 13:21:54 +08:00
README.md Added Dart to the supported languages list after verifying it. 2019-01-11 23:01:39 +03:00

Intellij rainbow brackets

Rainbow Brackets / Rainbow Parentheses for IntelliJ based IDEs.


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, ...

Screenshots

  • with Java

  • with Scala

  • with Clojure

  • with Kotlin

  • with HTML/XML

  • Scope highlighting

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

Alt + Button3:

  • looking forward to your screenshots(PR welcome!)

Install

For Windows - File > Settings > Plugins > Browse repositories... > Search for "Rainbow Brackets" > Install Plugin > Restart IntelliJ IDEA

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

Customize colors

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

Customize colors

Config file path

If you want to customize 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 /Users/izhangzhihao/Library/Preferences/IntelliJIdea2018.3/options/rainbow_brackets.xml.

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

In Windows env maybe like C:\Users\izhangzhihao\.IntelliJIdea2018.3\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 propertie "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 propertie "KOTLIN_FUNCTION_LITERAL_BRACES_AND_ARROW" cause our rainbow color been 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: The languages name should be lowercase, and do NOT use shorthand.

Contribute

  • gradle test
  • gradle runIde
  • gradle buildPlugin

Acknowledgements

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