Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

change color of bracket on highlight instead of background color #21

Closed
helgatheviking opened this Issue Apr 20, 2012 · 14 comments

Comments

Projects
None yet
6 participants

would it be possible to change the color of the brackets themselves when highlighted instead of highlighting via background color? i find it hard to see the actual bracket text when it is highlighted currently. plus the fact that the brackets turn red is probably my favorite feature from notepad++

Owner

facelessuser commented Apr 20, 2012

Sadly, Sublime Text regions do not allow the changing of the text (only background) color. If you need a lower profile showing of brackets, you can try outline or underline in the settings file. Just copy it to your User folder and make changes.

   // Outline? (solid|outline|underline|none)
    "quote_style" : "underline",
    "curly_style" : "underline",
    "round_style" : "underline",
    "square_style": "underline",
    "angle_style" : "underline",
    "tag_style"   : "outline",

You can also change the color by selecting a different scope to use for the region (it will use the color of whatever scope you give it in the setting). You can even add your own scope to your color scheme file and use that scope (details on how to do this are found in the readme.md file).

Example: Custom Color Scopes (scope must be found in your Color Scheme file):

    // Scope? (Defined in theme files.)
    // Examples: (keyword|string|number)
    "quote_scope" : "bracket.quote",
    "curly_scope" : "bracket.curly",
    "round_scope" : "bracket.round",
    "square_scope": "bracket.square",
    "angle_scope" : "bracket.angle",
    "tag_scope"   : "bracket.tag",

That is really the best I can offer with the limitations of the Sublime Text API.

well that's sad about the API limitation. so i'm trying to change the colors with no success. according to the readme i can put

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

in the color scheme file? and that will change the color for the bracket tag highlight? i must be missing something, b/c when i copy the whole sample from the readme, i still get the same awful solid green block on all my angle brackets that i had before. i can't even read what style of bracket it is anymore. i'd appreciate any more help you could spare.

Owner

facelessuser commented Apr 20, 2012

i still get the same awful solid green block on all my angle brackets

:)

I assure you it does work, but you are probably missing the other piece of the puzzle. Defining it in the color scheme file is not enough. You then need to use the scope by telling BH to use it in the settings file. Copy BracketHighlighter.sublime-settings to your Packages/User folder and change the setting below.

    "tag_scope"   : "bracket.tag",

That should change tags for you. You can then proceed to change all of them.

I know it isn't the most intuitive system. I still wish Sublime would just let me give it a color directly, but it doesn't. Post back if you are still having issues. It works, but you have to do it just right.

It works, but you have to do it just right.

i say the same thing to people who can't get their wordpress themes to work. :) thanks for your patience, i'm obviously new to sublime. i definitely didn't realize that there were 2 parts to the puzzle. i edited the user settings for brackethighlighter and still wasn't getting any color changes, until i realized that i was editing the wrong part of my new color scheme. the color XML must be inside the settings array of the color scheme.

now to pick some colors that won't hurt my eyes! thanks for your help.

Owner

facelessuser commented Apr 20, 2012

No problem. You aren't the first to have this issue. If we ever get the ability to directly set the colors, I will pick a less "eye hurting" color. I kind of assume most people will change it from the default scope anyways, and since everyone uses different color schemes, I have no idea what color it will actually be for someone. So changing it for one theme may cause ugliness to ensue in other themes.

Thx =D

Be taught

ckizer commented Dec 24, 2012

I still can't get it to do anything but outline as default. Outline is so distracting. How can I get solid color. The trick would be setting it as RGBa value so that you can set the alpha very low to work on any color theme. Does the plist support RGBa?

Please help me switch it to solid. Also I only want it to highlight the open/close bracket of tag I'm inside of (i ONLY use it for HTML)

Owner

facelessuser commented Dec 24, 2012

@ckizer I am not entirely sure everything you are asking about, but if you follow the instructions above you should be able to get solid. Use the solid option for the respective bracket style. For any further help, I will need very specific info from you, like your settings file.

ckizer commented Dec 26, 2012

Why can't I do alpha transparent color? RGBa values? It allows my highlight color to work with any theme :-(

–––––––––––––––––––
Cheers,

Court Kizer
kizer@me.com
“We are the universe experiencing itself”

On Dec 24, 2012, at 4:21 PM, Isaac Muse notifications@github.com wrote:

@ckizer I am not entirely sure everything you are asking about, but if you follow the instructions above you should be able to get solid. Use the solid option for the respective bracket style. For any further help, I will need very specific info from you, like your settings file.


Reply to this email directly or view it on GitHub.

Owner

facelessuser commented Dec 27, 2012

You can...I don't understand what you are doing. When you ask, you need to explain how you are doing what you are doing, so I can correct you if you are doing it wrong.

Example: Here I defined no transparency in my theme file.

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

Screen Shot 2012-12-27 at 9 23 02 AM

Here I defined transparency:

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

Screen Shot 2012-12-27 at 9 22 42 AM

I can't promise ST2 will blend the background color well. It appears ST2 simulates transparency. I don't know if ST2 will blend the background colors proper with the bracket regions, but that would be a ST2 problem not a BracketHighlighter problem.

dotku commented Feb 9, 2016

thin underscore?

My question is, why my underscore is thin little one?
I'm using spacegray theme, it seems there is another setting for curly braket highlight?(thre are two underscore tegether with one white underline and other red underline)

Owner

facelessuser commented Feb 9, 2016

You have the ST bracket matcher still enabled along with BracketHighlighter's. You need to disable the ST matcher in Preferences.sublime-settings: http://facelessuser.github.io/BracketHighlighter/usage/#suggested-user-settings.

dotku commented Feb 9, 2016

@facelessuser Great!It works~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment