absop / RainbowBrackets

A rainbow brackets plugin for SublimeText4.
MIT License
54 stars 8 forks source link

Automatically apply rainbow on file open #16

Closed ezzatron closed 3 years ago

ezzatron commented 3 years ago

Hi there. I could have sworn this package used to apply rainbow brackets when opening a file. Now it seems like I have to do it manually. Is there a way to get the bracket coloring to apply automatically again?

https://user-images.githubusercontent.com/100152/117381400-55026780-af1f-11eb-9601-44c3013b8e13.mov

My config looks like this:

{
  "debug": true,
  "languages":
  {
    "javascript":
    {
      "extensions":
      [
        "js",
        "jsx"
      ],
      "mode": "all"
    }
  },
  "rainbow_colors":
  {
    "matched":
    [
      "#FE8F95",
      "#F9C189",
      "#C2ECA2",
      "#78E6F4",
      "#EAA1FE"
    ],
    "unmatched": "#CCCCCC"
  }
}
ezzatron commented 3 years ago

Never mind, I guess my config was out of date. Updated config that worked for me:

{
  "brackets": {
    "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"
        ]
      },
      "js": {
        "opening": [
          "(",
          "[",
          "{"
        ],
        "ignored_scopes": [
          "comment",
          "string"
        ],
        "extensions": [
          "js",
          "jsx",
          "ts",
          "tsx"
        ]
      }
    }
  },
  "rainbow_colors": {
    "matched": [
      "#FE8F95",
      "#F9C189",
      "#C2ECA2",
      "#78E6F4",
      "#EAA1FE"
    ],
    "mismatched": "#CCCCCC"
  }
}