4

For now open and close brackets { } highlights as underline _

I don't like it

But I can't find, is there way to change it to bolding or / and background change as in most of other editors?

cnd
  • 32,616
  • 62
  • 183
  • 313
  • if you are still interested in doing this without a plugin, I just posted how to do so __[HERE](http://stackoverflow.com/a/36212516/4955183)__ – Enteleform Mar 25 '16 at 01:08

3 Answers3

4

Take a look at the BracketHighlighter plugin.

Edit Try this for your Packages/User/bh_core.sublime-settings

{
    // Define region highlight styles
    "bracket_styles": {
        // "default" and "unmatched" styles are special
        // styles. If they are not defined here,
        // they will be generated internally with
        // internal defaults.

        // "default" style defines attributes that
        // will be used for any style that does not
        // explicitly define that attribute.  So if
        // a style does not define a color, it will
        // use the color from the "default" style.
        "default": {
            "icon": "dot",
            // BH1's original default color for reference
            // "color": "entity.name.class",
            "color": "brackethighlighter.default",
            "style": "underline"
        },

        // This particular style is used to highlight
        // unmatched bracekt pairs.  It is a special
        // style.
        "unmatched": {
            "icon": "question",
            // "color": "brackethighlighter.unmatched",
            "style": "outline"
        },
        // User defined region styles
        "curly": {
            "icon": "curly_bracket",
            // "color": "brackethighlighter.curly",
            "style": "full"
        },
        "round": {
            "icon": "round_bracket",
            // "color": "brackethighlighter.round",
            "style": "full"
        },
        "square": {
            "icon": "square_bracket",
            // "color": "brackethighlighter.square",
            "style": "full"
        },
        "angle": {
            "icon": "angle_bracket",
            // "color": "brackethighlighter.angle",
            "style": "full"
        },
        "tag": {
            "icon": "tag",
            // "color": "brackethighlighter.tag",
            "style": "outline"
        },
        "single_quote": {
            "icon": "single_quote",
            // "color": "brackethighlighter.quote",
            "style": "full"
        },
        "double_quote": {
            "icon": "double_quote",
            // "color": "brackethighlighter.quote",
            "style": "full"
        },
        "regex": {
            "icon": "regex",
            // "color": "brackethighlighter.quote",
            "style": "full"
        }
    }
}
skuroda
  • 19,514
  • 4
  • 50
  • 34
  • okay, but I don't like this thing – cnd Feb 21 '14 at 04:41
  • Perhaps you can clarify what you don't like. The plugin allows y ou to customize the style around the brackets, which is what you asked for. – skuroda Feb 21 '14 at 04:46
  • This plugin is very complex, it's just confusing me and make things even more weird. All I really wanted is just exchange underline with something else in highlighting. – cnd Feb 21 '14 at 04:54
  • While it does offer a high level of customization, you can modify the styles relatively easily. See https://github.com/facelessuser/BracketHighlighter#configuring-highlight-style. I've updated my answer with some settings to highlight the backgrounds for brackets. You can play with some different scopes to get the color right, but hopefully this gets you closer to what you want to do. – skuroda Feb 21 '14 at 05:44
2

Just go "Sublime Text -> Preferences -> Package Settings -> Bracket Highlighter -> Bracket Setting - User".

Then paste the following configuration and press "Save". That should fix it.

{
    "bracket_styles": {
        "default": {
            "icon": "dot",
            "color": "brackethighlighter.default",
            "style": "none"
        },
        "unmatched": {
            "icon": "question",
            "style": "outline"
        },
        "curly": {
            "icon": "curly_bracket"
        },
        "round": {
            "icon": "round_bracket"
        },
        "square": {
            "icon": "square_bracket"
        },
        "angle": {
            "icon": "angle_bracket"
        },
        "tag": {
            "icon": "tag"
        },
        "c_define": {
            "icon": "hash"
        },
        "single_quote": {
            "icon": "single_quote"
        },
        "double_quote": {
            "icon": "double_quote"
        },
        "regex": {
            "icon": "regex"
        }
    }
}

p.s. I'm aware that this is an old question - this is for reference!

avloss
  • 2,389
  • 2
  • 22
  • 26
1

Paste this to your Theme_of_choise.tmTheme next to other stuff in settings. And no there are no bracketBackground key :(

<key>bracketsForeground</key>
<string>#FF0000</string>
<key>bracketsOptions</key>
<string>foreground</string>

<key>bracketContentsForeground</key>
<string>#FF0000</string>
<key>bracketContentsOptions</key>
<string>foreground</string>
Jonas
  • 11
  • 1