absop / RainbowBrackets

A rainbow brackets plugin for SublimeText4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make Rainbow on each open file

sollymay opened this issue · comments

It would be awesome that we would have an option to match brackets by default on open files and keep updating those matches on changes.

It would be awesome that we would have an option to match brackets by default on open files and keep updating those matches on changes.

What is you really want? an setting option, or a command?

If we want do this by modifying custom user settings file, I would consider to add a brackets set type with name/key ".*" to match any file.

There is a bug of rendering regions in Sublime Text 4, which makes RainbowBrackets can't work well in Sublime Text 4 (Some bracket colors are sometimes not drawn as required by plugin), and the authors of Sublime Text has not fixed this Bug yet, it's been a while. And VSCode has put the feature of bracket pair colorization into the core of the editor.

So actually I don’t have much motivation to update this plugin at the moment.

It would be awesome that we would have an option to match brackets by default on open files and keep updating those matches on changes.

What is you really want? an setting option, or a command?

If we want do this by modifying custom user settings file, I would consider to add a brackets set type with name/key ".*" to match any file.

So realistically what i want is to mimic the functionality of bracket pair colorizer (in vs code, you get colorization by default, meaning you dont have to "activate" it by invoking a command or a shortcut, but its kind of like a background process).

I know this is possible, because there are other plug ins that by default colorize comments, etc. This would be essentially the same. A setting/option so that every file is automatically colorized when you double click on it and that keeps updating colorization on save.

I've updated the plugin so that you can change the settings to suit your purpose.

However, the documentation for the plugin has not been updated and no new version has been released, so you can only install the latest version by downloading/cloning the repository yourself.

Now, the configuration of the plugin is come up with the following settings

{
    "debug": false,

    "default_config": {
        "bracket_pairs": {
            "(": ")",
            "[": "]",
            "{": "}"
        },

        "coloring": false,

        "enabled": true,

        "ignored_scopes": [
            "comment",
            "string",
            "constant"
        ],

        "rainbow_colors": [
            "#FF0000", // level0
            "#FF6A00", // level1
            "#FFD800", // level2
            "#00FF00", // level3
            "#0094FF", // level4
            "#0041FF", // level5
            "#7D00E5"  // level6
        ],

        "mismatch_color": "#FF0000"
    },

    "syntax_specific": {
        "Scheme": {
            "extensions": [".scm", ".ss"],

            "ignored_scopes": [
                "comment", "string", "constant", "symbol"
            ]
        },

        "JSON": {
            "bracket_pairs": {
                "{": "}",
                "[": "]"
            },

            "extensions": [
                ".json",
                ".sublime-build",
                ".sublime-color-scheme",
                ".sublime-commands",
                ".sublime-keymap",
                ".sublime-menu",
                ".sublime-settings",
                ".sublime-theme",
            ],

            "ignored_scopes": [
                "comment", "string"
            ]
        }
    }
}

For configuration in "syntax_specific", the missing options will be provided by "default_config", except for "coloring" and "enabled" (they are true by default in configuration in "syntax_specific").

So, you can achieve your goal by setting both the "coloring" option and the "enabled" option in "default_config" to true.

thank you @absop, sorry for the late reply. Was out and very far away from a computer. Will test this and let you know. Thank you for the fast turnaround helping with this feature and hope it gets eventually baked into a new version 👍

Hey @absop! I was able to test and this works flawlessly. Thank you for the help!

Hoping to see this as part of a future package release now.

Happy holidays!

Thanks for your feedback, I have released the new version.