Search code examples
themessublimetexttextmatecolor-scheme

Sublime Text / Textmate color scheme - change highlight color


I want some of the highlighting color of sublime text themes to be more intense.

  1. When I select a word, Sublime Text marks all instances of this word in the file. It marks it with very light square around the word. How can I change this color to make it more intense? Can I color the inside of the square?

  2. When the text sign is on one side of brackets / parenthesis, it marks both sides with very light underline. same thing - How can I control the color and intensity of this underline? Can I also color above the underline (the entire character background)?

What fields should I change?

Two pictures of exactly what I mean, using the "Neon" color scheme:

instances brackets


Solution

  • I'm the author of the Neon theme - thank you for using it! Unfortunately, the two examples you show, automatic highlighting of matching selections and bracket matching, don't appear to be separately themeable. If you take a look at the source of Neon.tmTheme lines 20-47, you'll see the keys that set various colors for everything except the syntax highlighting - the selection color and outline, caret color, indentation guides, etc. I've collected all these values over a couple years of looking at lots of different color schemes and a lot of googling, but I haven't found any settings that specifically target what you're asking about. Instead, it appears that they are colored with either the caret color or, more likely, the foreground color (they are both the same in Neon).

    So, while unfortunately there isn't much you can do about the first issue, there is a solution for bracket matching - the BracketHighlighter plugin.

    Neon with BracketHighlighter

    Neon includes settings for BracketHighlighter, so all you need to do is configure the plugin itself to use them. Here are the "bracket_styles" I use:

    "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": "underline"
        },
        "round": {
            "icon": "round_bracket",
            "color": "brackethighlighter.round",
            "style": "underline"
        },
        "square": {
            "icon": "square_bracket",
            "color": "brackethighlighter.square",
            "style": "underline"
        },
        "angle": {
            "icon": "angle_bracket",
            "color": "brackethighlighter.angle",
            "style": "underline"
        },
        "tag": {
            "icon": "tag",
            "color": "brackethighlighter.tag",
            "style": "outline"
        },
        "single_quote": {
            "icon": "single_quote",
            "color": "brackethighlighter.quote",
            "style": "underline"
        },
        "double_quote": {
            "icon": "double_quote",
            "color": "brackethighlighter.quote",
            "style": "underline"
        },
        "regex": {
            "icon": "regex",
            "color": "brackethighlighter.quote",
            "style": "underline"
        }
    },
    

    Hopefully this helps you out. If you have any other questions, concerns, or general feedback about Neon, please feel free to open an issue and I'll see what I can do.