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

Rainbow​Brackets

by absop ST3

A rainbow brackets plugin for SublimeText3.

Details

Installs

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

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