Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change highlight colour in Sublime Text 3?

How can I change the default highlight colour in Sublime Text 3? I used to know how find a highlight key in one of the theme files in ST2 but things changed quite on ST3. Are they in the library somewhere? "Preference >> Browse Package" is almost empty.

like image 730
erdembayar Avatar asked Sep 01 '16 03:09

erdembayar


People also ask

How do you change the highlight color on text?

Highlight selected text Select the text that you want to highlight. Go to Home and select the arrow next to Text Highlight Color. Select the color that you want. Note: Use a light highlight color if you plan to print the document by using a monochrome palette or printer.

How do you highlight in Sublime Text?

🖍 Text Marker (Highlighter) Simply use Alt + Space to mark selected text.

How do I change the Color Scheme in Sublime Text?

Load in the syntax theme from the top menu: Sublime Text > Preferences > Color Scheme > themename. If you want to tweak you syntax further up can upload the custom theme back in the web-based theme editor and save it out again.

How do I change the color scheme in Sublime Text 3?

Some developers will prefer a simplistic black on white interface, while others prefer a more colourful interface or a darker theme. Sublime Text 3 has a number of pre-installed themes that can be enabled by clicking on “Preferences” in the top bar, then clicking “Color Scheme”. Click on “Preferences” in the top bar, then click “Color Scheme”.

How does Sublime Text highlight source code and prose?

The highlighting of source code and prose in Sublime Text is controlled by a color scheme. A color scheme assigns colors and font styles to scopes, which are assigned to the text by the syntax.

How do I use hashed syntax highlighting in Sublime Text?

To use hashed syntax highlighting, the "foreground" key must have a value that is an array of two or more colors. Sublime Text will create 256 different colors that are linear interpolations (lerp) between the colors provided. The interpolation is done in HSL space.

What are the features of Sublime Text theme?

The theme controls such elements as buttons select lists, the sidebar and tabs. Sublime Text color schemes are implemented using .sublime-color-scheme files, containing JSON. Sublime Text also supports a subset of features using the TextMate .tmTheme format. Before Sublime Text 3.1, only the .tmTheme format was supported.


2 Answers

You can see which theme you are using by going to

Preferences>Colour Scheme 

and see which one is ticked.

Open the theme file and find the key that says:

<key>selection</key> 

Go to a site that shows hex colour codes (like this one http://html-color-codes.com/) and find the code for the colour you want. Then sub your new colour code into the line below the selection key in the theme file, replacing the old hex colour code.

Save the modified theme file and it should work straight away.

EDIT
Install PackageResourceViewer plugin using package control. Open the command palette with P (for windows/linux CtrlShiftP) and type prv to get the PackageResourceViewer options. Choose Open Resource >>Theme- YourTheme >> and edit your theme file

like image 149
Tony Vincent Avatar answered Sep 20 '22 21:09

Tony Vincent


Tony Vincent's answer is excellent, and I would also add that if changing the selection color makes the selected text difficult to read, selectionForeground is the key to change. For example:

<key>selectionForeground</key> <string>#000000</string> 
like image 43
user2616155 Avatar answered Sep 20 '22 21:09

user2616155