Sublime Forum

Change colors for selected text and currently highlighted line

#1

Sublime version: Version 3.0, Build 3143
OS : Fedora 26, Microsoft Windows 7

I am new to sublime and I use Material theme which is dark.

Question1. How can I change the background color of selected text (word/multiple words)? Any colour suggestion for selected word for a dark theme like ‘Material theme’ ?

From googling , I found a way to do this: it involves the following 3 steps.

Select the word/words
Press Ctrl+F 
Alt + F3

But, I want to achieve this when I just select a word/words . Notepad++ does this . Its called smart highlighting I think.

Question2. How can I change the colour of currently highlighted line ? Again, any color suggestion for current line for a dark theme ?

0 Likes

#2

To specify the color for highlighting the current line Sublime Editor for Windows 7, I followed the instructions mentioned by ‘MattDMo’ in the following post.

But, I cannot find a .tmTheme file in any directories under C:\Users\User\AppData\Roaming\Sublime Text 3\Packages

So, I manually created a folder named Color Scheme – Default and placed test2.tmTheme file there with the following line

C:\Users\User\AppData\Roaming\Sublime Text 3\Packages\Color Scheme - Default>type test2.tmTheme
<key>lineHighlight</key>
<string>#F0FF00</string>

But, it didn’t work.
In my settings, I had already set "highlight_line": true

0 Likes

#3

You need to edit your theme file and change the linehighlight and selection colors. You could install the package:

  1. https://packagecontrol.io/packages/PackageResourceViewer

To find your theme file and then open it, so you can edit the colors. This bellow is a example for the Notepad++ Color Scheme:

You can highlight the colors as on the screenshot with the:

  1. https://packagecontrol.io/packages/Color%20Highlighter

package, however if you install this package, you need to restart sublime text to the changes take effect.

3 Likes

#4

Dumb question. How do I actually find and open this? A search in my OS? Do I use the console? Or Preferences > Package Settings > PackageResourceViewer Because none of these seems to show the file you are editing

0 Likes

#5

Go to Tools -> Command Palette and type the command PackageResourceViewer: Open Resource, then you need to find where your theme file is.

4 Likes

#6

That works thanks!

0 Likes

#7

No such folders. You can edit scheme using package PackageResourceViewer. It loads list of objects.

0 Likes