Sublime Forum

How to change indicator for parentheses match highlighting?

#1

Hello,

Just recently purchased Sublime Text 2, loving it so far, amazing, love the Vim bindings support and the UI, just one thing I noticed is that when indicating which parentheses match up with which, the indicator seems to be by default a subtle underline - is it possible to change this to something more noticeable like a highlight or a color change?

Thanks!

1 Like

#2

In the theme file, such as Monkai, you have the following to control this:
bracketsForeground
bracketsOptions
bracketContentsForeground
bracketContentsOptions
tagsForeground
tagsOptions

xxxForeground controls the color of the underline and text, while xxxOptions contains a space separated list of flags, which may be ‘underline’ and ‘foreground’. ‘underline’ will show an underline, while ‘foreground’ will show the text itself in a different color.

‘bracketsXXX’ is used when the caret is next to the brackets, while ‘bracketContentsXXX’ is used when the caret is between brackets. If you set all the bracketsXXX and bracketContentsXXX keys to the same value, then there will be no visual difference between having the caret next to a bracket or not.

1 Like

#3

Ah got it - now… where does one usually find said “theme file?” :smiley: (I use Solarized Dark is that’s any help)

0 Likes

#4

For Windows XP: C:\Documents and Settings[user name]\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Solarized (Dark).tmTheme
For Windows 7: C:\Users[user name]\AppData\Roaming\Sublime Text 2\Packages\Color Scheme - Default\Solarized (Dark).tmTheme
For OS X: /users/[user name]/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default/Solarized (Dark).tmTheme

1 Like

#5

Hm… can’t seem to find any of the options in the Solarized (Dark) theme file… is it possible it doesn’t have that option?

Help?

0 Likes

#6

They are options specific to sublime and most themes were written for textmate. If you look at the Monokai theme you will see the options and formats, copy them to your theme and change colors and options as you wish.

Note that foreground refers to the color of the brackets themselves and not the text between the brackets. My settings are as follows:

            <key>bracketsForeground</key>
            <string>#91FF00</string>
            <key>bracketsOptions</key>
            <string>underline foreground</string>

            <key>bracketContentsForeground</key>
            <string>#91FF00</string>
            <key>bracketContentsOptions</key>
            <string>underline foreground</string>

            <key>tagsForeground</key>
            <string>#91FF00</string>
            <key>tagsOptions</key>
            <string>stippled_underline</string>
1 Like

#7

This is a reply four years later, but theme integration has only improved in that time, making this a much safer reply now.

Any key-string combo in another Color Scheme - Default tmTheme file can be used in any other tmTheme file.

Little things like a typo can wipe out a theme’s display, so always copy theme file backup. When a mistake, shut down Sublime, copy in backup and start over, carefully.

1 Like