Sublime Forum

.tmTheme files - change selection background

#1

Solarized (Dark).tmTheme selection barely visible Does anyone know how to: change selection background color…

PackageResourceViewer .tmTheme edits so far…
line 20   <key>lineHighlight</key>
line 21     <string>#001029</string>
line 22   <key>selection</key>
line 23     <string>#0099ff30</string>
line 24   <key>selectionBorder</key>
line 25     <string>#99ccff</string>
line 26   <key>inactiveSelection</key>
line 27     <string>#0099ff25</string>
??
<key> ? selection background ? </key>
<string>#001029</string>

Assume that a <keyword> can be used but need exact keyword.
      (selectionBackground or backgroundSelection are not working )
Does anyone know keyword used to set selection background color in Sublime Text .tmTheme file?

0 Likes

#2

Yes. I tried to read you text but I could not. Write in one simple question what you want to. Follow this templete, it may help you:

From https://github.com/SublimeTextIssues/Core/issues

0 Likes

#3

Please just answer the only questioned asked!

How do we change selection background color?

The additional data describes coding environment in which data changes occur.

0 Likes

#4

Found this on your language theme file:

        <dict>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#FFFFFF</string>
                <key>guide</key>
                <string>#8c8c8c</string>
                <key>stackGuide</key>
                <string>#8c8c8c</string>
                <key>activeGuide</key>
                <string>#FF0000</string>
                <key>caret</key>
                <string>#000000</string>
                <key>foreground</key>
                <string>#000000</string>
                <key>invisibles</key>
                <string>#B3B3B3</string>
                <key>lineHighlight</key>
                <string>#DADAFF</string>
                <key>selection</key>
                <string>#B9B9B9</string>
            </dict>
        </dict>

There you see the line lineHighlight, what comes next is the color DADAFF. More info see this other answer: changing-text-color-for-plain-text-syntax

0 Likes

#5

Your example and link are no help. Keyword <background> is color for entire page background. Answer the question, please :unamused:. What is the keyword to change selection background.

0 Likes

#6

selection

It is right below lineHighlight

0 Likes

#7

You want the selection key, the following will set the selection background to red:

<key>selection</key>
<string>#FF0000</string>

There are two other related keys:

     <key>selection</key>                    
     <string>#75715e</string>
     <key>selectionBorder</key>              
     <string>#75715e</string>
     <key>selectionForeground</key>          
     <string>#272822</string>

There is documention here on color schemes. The docs say selectionBackground colors the selection regions, it doesn’t, selection does, selectionBackground doesn’t do anything.

1 Like

#8

<selection> is not changing “selection background color”.

0 Likes

#9

Then that’s a different issue entirely, but do try selectionBackground just I case I’m wrong about it doing nothing (I’m not).

It could be any number of issues, probably a caching issue.

But that’s the right key to change the selection background.

0 Likes

#10

Are you sure? Look at this:

There are some packages which freezes you theme file (sadly true), so any changes will not take effect. Also, be sure you are modifying the right file and you saved your changes.

0 Likes

#11

Yep. I’ve done that :slightly_smiling:

0 Likes

#12

Caching issue… :confounded:

Just to clarify, I am using Sublime Text 3, Stable Channel, Build 3126.
ST3 removes ST2 easy access to theme file editing, so packagecontrol.io PackageResourceViewer.

  • Solarized (Dark).tmTheme is extracted
  • extracted file is edited
  • selectionBackground keyword is not working.
  • selection keyword is not working
    machine is MacPro 2016 (SIP-enabled hardware)
0 Likes

#13

If you’re using something like Sublime Linter, then it may be creating a custom theme, generated from the original one, with the linter colors added. I think the plugin Color Highlighter does something similar.

Sublime Linter creates a color scheme with the same name suffixed with “(SL)”. You’ll find those in Packages/User/SublimeLinter/*(SL).tmTheme.

To check what color scheme is currently set look at your preferences.

1 Like

#14

Preferences shows Solarized (Dark)
Extracted file is at this location on mac:
~Library/Application Support/Sublime Text 3/Packages/Color Scheme - Default/Solarized (Dark).tmTheme

Extracted file is correctly implementing <selectionBorder> border in workspace. That is, selection border can be edited and updates okay. But gerry and addons_zz are confusing this thread:
gerry says use keyword selectionBackground
addons_zz says use keyword selection.

1 Like

#15

No. I didn’t.

0 Likes

#16

Yes you did! And your link info backs that up.
http://docs.sublimetext.info/en/latest/reference/color_schemes.html#selection
Something is blocking the correct use of keywords?
Something is blocking edit of selection background color.

1 Like

#17

I said:

Now, I’m sorry, but I can’t help you any further.

2 Likes

#18

Right, so this question remains unanswered. For now do we assume, cache issue.

REQUEST: get keywords <selection> and <selectionBackground> working in Sublime Text 3 Build 3126.

Thanks!

0 Likes

#19

This below is on Sublime Text x86 - Build 3126 - Windows 10. It not that what you want to?

https://forum.sublimetext.com/uploads/default/original/3X/f/8/f899578509f6bded366101140945fda237c9466d.gif

You may get the settiings used to record the animated git here: https://github.com/evandrocoan/SublimeTextStudio#installation

After it, edit the file Packages\SublimeNotepadPlusPlusTheme\DefaultStylersTheme.tmTheme on Sublime Text. You will get exactly the same image as the animation.

If it is cache issue, you need to find what package is caching it, and delete that cache or disable/remove the package while editing the language theme file.

0 Likes

#20

Here is a better Forum thread to follow as the ‘packages’ mystery unravels.
CSS Color Formatting Not Working

0 Likes