17

For me Bracket Highlighter plugin is not coloring and highlighting brackets but just underlining them in white.

Here is a snapshot:

Sublime BracketHighlighter only underlines doesn't highlight

Anyone knows of a solution?

3 Answers 3

31

I have modified my example based upon the comments of AGS - it now includes a couple of highlight options and the rest are outline. Thank you AGS and thank you to the original poster for creating this useful thread.


bh_core.sublime-settings

{
    "bracket_styles": {
        // This particular style is used to highlight
        // unmatched bracket pairs. It is a special
        // style.
        "unmatched": {
            "icon": "question",
            "color": "brackethighlighter.unmatched",
            "style": "highlight"
        },
        // User defined region styles
        "curly": {
            "icon": "curly_bracket",
            "color": "brackethighlighter.curly",
            "style": "highlight"
        },
        "round": {
            "icon": "round_bracket",
            "color": "brackethighlighter.round",
            "style": "outline"
        },
        "square": {
            "icon": "square_bracket",
            "color": "brackethighlighter.square",
            "style": "outline"
        },
        "angle": {
            "icon": "angle_bracket",
            "color": "brackethighlighter.angle",
            "style": "outline"
        },
        "tag": {
            "icon": "tag",
            "color": "brackethighlighter.tag",
            "style": "outline"
        },
        "single_quote": {
            "icon": "single_quote",
            "color": "brackethighlighter.quote",
            "style": "outline"
        },
        "double_quote": {
            "icon": "double_quote",
            "color": "brackethighlighter.quote",
            "style": "outline"
        },
        "regex": {
            "icon": "regex",
            "color": "brackethighlighter.quote",
            "style": "outline"
        }
    }
}

whatever_theme_file_you_use.tmTheme

<!-- BEGIN Bracket Highlighter plugin color modifications -->

<dict>
    <key>name</key>
    <string>Unmatched</string>
    <key>scope</key>
    <string>brackethighlighter.unmatched</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FD971F</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Bracket Curly</string>
    <key>scope</key>
    <string>brackethighlighter.curly</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FF0000</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Bracket Round</string>
    <key>scope</key>
    <string>brackethighlighter.round</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#0000FF</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Bracket Square</string>
    <key>scope</key>
    <string>brackethighlighter.square</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#800080</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Bracket Angle</string>
    <key>scope</key>
    <string>brackethighlighter.angle</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#AE81FF</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Bracket Tag</string>
    <key>scope</key>
    <string>brackethighlighter.tag</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FD971F</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Single Quote | Double Quote | Regex</string>
    <key>scope</key>
    <string>brackethighlighter.quote</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#AE81FF</string>
    </dict>
</dict>

<!-- END Bracket Highlighter plugin color modifications -->
2
  • Search for the word bracket inside your theme file to see if there are conflicts with the settings listed above -- some themes come with bracket settings. Also check to see if your syntax for the file is selected to something code-like. For example, not much ever happens in plain old text mode. Pick a color like red to do your tests so that you can really see if something is happening, and pick something simple like [] square brackets. Try outline and also highlight just to see if the plugin is doing something. My post is merely an excerpt of the ingredients necessary.
    – lawlist
    Mar 29, 2013 at 2:59
  • 1
    Tip: if you don't have a bh_core.sublime-settings file, create one using the content posted in this answer.
    – renatov
    Feb 23, 2014 at 23:11
10

Edit your ~/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_core.sublime-settings

And set "style" to "highlight" for each bracket type you want highlighted. Here is an example for curly brackets.

 // User defined region styles
 "curly": {
     "icon": "curly_bracket",
     "color": "entity.name.class",
     "style": "highlight"
 }
4
  • 2
    cool, I am able to highlight it, but now it highlights all of them with the same color, i.e. white even though I have set explicit colors for every type.
    – bootkick
    Mar 27, 2013 at 17:36
  • Like @lawlist mentioned, you need to set the colors in your .tmTheme file, and call those in your bh_core.sublime-settings file. (White is the BH2 default, I believe)
    – AGS
    Mar 27, 2013 at 17:45
  • Hmm... this is really weird. coz on my other pc bracket highlighter works awesomely fine and I dint have to set anything up for it.
    – bootkick
    Mar 27, 2013 at 17:49
  • You can also use "solid" instead of "highlight".
    – toni rmc
    Feb 4, 2017 at 3:31
5

Restart Sublime.

I just spent 20 mins hunting and trying all the above etc. Finally found a comment elsewhere suggesting a restart; which fixed it and gave me a brief moment long enough to slap myself hard while it reloaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.