ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Rainbow​Brackets

by absop ST3

A rainbow brackets plugin for SublimeText3.

Details

Installs

  • Total 10K
  • Win 5K
  • Mac 3K
  • Linux 2K
Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 1 9 10 17 13 11 9 17 15 18 20 9 9 10 17 12 7 14 14 14 11 13 10 16 18 19 9 14 10 4 12 16 12 6 11 16 16 14 19 24 9 13 15 21 7 17
Mac 0 7 3 2 5 4 4 6 6 9 5 2 3 2 5 4 4 4 9 1 4 5 5 3 6 4 7 6 8 5 6 2 7 0 6 13 6 8 3 9 2 3 2 13 8 6
Linux 0 3 6 4 6 2 2 2 4 7 6 10 7 3 7 8 7 7 5 7 6 4 4 5 6 5 7 5 9 3 8 5 5 2 3 5 4 7 6 6 3 0 5 2 6 7

Readme

Source
raw.​githubusercontent.​com

RainbowBrackets

License Downloads

Introduction

RainbowBrackets uses the brackets and colors that you give in the settings file, searches and highlights brackets in file views. Brackets at different levels will be dyed with different colors according to the settings. Colors are gave in a list, and will be used repeatedly.

parentheses, braces, brackets are treated as brackets. brackets are configured in setting file, it means you can use OO as a opening bracket and CC as a close bracket. some characters will cause many match error, can't serve as brackets, such as <>.

Example

{ [ 【 OO OO 《《》OOxCC》 CC CC 】 ] }

Installation

Clone or download this repository to your Packages directory of Sublime Text. Note that the directory name should be the name of this repository.

If you have installed Package Control, press down ctrl+shift+p to get into the command palette, then, input the command pcip (Package Control: Install Package) and Enter to run it. Wait some time… After package infomations have been loaded remotely, input the name of this plugin RainbowBrackets, and press down Enter to install it.

Usage

Settings

Settings template

{
    "debug": false,

    "brackets": {
        // opening must in pairs
        "pairs": {
            "(": ")",
            "[": "]",
            "{": "}"
        },

        "filetypes": {
            "default": {
                "opening": ["(", "[", "{"],
                "ignored_scopes": [
                    "comment", "string"
                ]
            },

            "scheme": {
                "opening": ["(", "[", "{"],
                "ignored_scopes": [
                    "comment", "string", "constant.character", "symbol"
                ],
                "extensions": [
                    "scm",
                    "ss"
                ]
            },

            "json": {
                "opening": ["[", "{"],
                "ignored_scopes": [
                    "comment", "string"
                ],
                "extensions": [
                    "json",
                    "sublime-settings",
                    "sublime-menu",
                    "sublime-build",
                    "sublime-keymap",
                    "sublime-commands",
                    "sublime-theme",
                    "sublime-color-scheme"
                ]
            },
            // Add custom file types here.
        }
    },

    "rainbow_colors": {
        "matched": [
            "#FF0000",   /* level1  */
            "#FF6A00",   /* level2  */
            "#FFD800",   /* level3  */
            "#00FF00",   /* level4  */
            "#0094FF",   /* level5  */
            "#0041FF",   /* level6  */
            "#7D00E5"    /* level7  */
        ],
        "mismatched": "#FF0000"
    }
}
  • ignored_scopes: to ignore brackets in some scopes(such as comment, string).
  • pairs: global brackets pairs dict, opening brackets(left brackets) as keys and closing brackets(right brackets) as values.
  • opening: left parts of brackets pairs to be searched.

Commands

  • Preferences: RainbowBrackets Settings
  • RainbowBrackets: toggle debug
  • RainbowBrackets: make rainbow
  • RainbowBrackets: clear rainbow
  • RainbowBrackets: clear color schemes

Key bindings

RainbowBrackets support fast opreating brackets, including select, remove and transform.

Keys Description
ctrl+alt+9 Replace the brackets around the cursors with ()
ctrl+alt+0 Replace the brackets around the cursors with ()
ctrl+alt+[ Replace the brackets around the cursors with []
ctrl+alt+] Replace the brackets around the cursors with []
ctrl+alt+shift+[ Replace the brackets around the cursors with {}
ctrl+alt+shift+] Replace the brackets around the cursors with {}
ctrl+alt+r Remove the brackets around the cursors
ctrl+alt+. Remove the brackets around the cursors and select the text within the brackets
ctrl+alt+, Select the brackets around the cursors and the text within the brackets

Screenshots

  • Material color scheme, JSON file.
  • Material color scheme, Scheme language
  • Material lighter color scheme, Scheme language