Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 : colour of edited file tab?

I see that the Sublime Text theme (.config/sublime-text-2/Packages/Theme - Default/Default.sublime-theme) can be edited to make the open tab more obvious.

For that I use

{     "class": "tab_control", "attributes": ["selected", "file_medium_dark"],     "tint_modifier": [0, 255, 0, 32]     /* ... */ }, 

which makes the tab greener.

Is there a similar method for colouring the tab of an edited (unsaved) file/buffer?

Thanks.

like image 698
Rhubbarb Avatar asked Jul 02 '12 13:07

Rhubbarb


People also ask

How do I change the sidebar color in Sublime Text?

Then in Preferences > Browse Packages > User, create a new file and call it Default. sublime-theme (be sure that the extension is in . sublime-theme). Then you can change the sidebar color by changing the RGB values of “Background color”.

Where Are Sublime Text color schemes stored?

Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages.


2 Answers

After a little hunting around together with Mikko's suggestion of looking at the change log:

In Settings-User opened from Preferences | Settings add in the line

"highlight_modified_tabs": true, 

This will make the tab text orange whenever there are unsaved changes to a file.

To change the color from orange, a bit of further digging around and experimentation was needed and revealed that editing the theme was one way to change the color from orange.

Theme files can be located in in the Color Scheme - Default folder accessed from the menu Preferences | Browse Packages... - you will have to make these changes for every theme that you'd like to change the text color for:

{     "class": "tab_control", "attributes": ["selected", "file_medium_dark"],     "tint_modifier": [0, 255, 0, 40],     "layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",     "layer2.opacity": 0.7 }, {     "class": "tab_control", "attributes": ["dirty", "file_medium_dark"],     "tint_modifier": [255, 0, 0, 40],     "layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",     "layer2.opacity": 0.7 }, {     "class": "tab_control", "attributes": ["selected", "dirty", "file_medium_dark"],     "tint_modifier": [255, 255, 0, 40],     "layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",     "layer2.opacity": 0.7 }, 

It would be nice to be control the behavior of "selected" and "dirty" (=modified) separately. That might be possible with the layers, but I don't understand those well enough yet.

Addenda

(1) The above is for dark themes. For a light theme, omit the "file_medium_dark" from the attributes.

(2) The same changes apear to work in Sublime Text 3 (~/.config/sublime-text-3/Packages/Default.sublime-theme).

like image 82
Rhubbarb Avatar answered Sep 21 '22 07:09

Rhubbarb


This is the best solution I have found: https://coderwall.com/p/jg4kog

  1. Inside of Sublime Text go to Preferences > Browse packages

  2. Navigate to the User folder.

  3. There you create a file called Default.sublime-theme

  4. Open that file in Sublime Text and copy and paste the following JSON object:

[{     "class": "tab_control",     "attributes": ["selected", "file_medium_dark"],     "tint_modifier": [255, 255, 255, 80] }] 
like image 32
Ravi Ram Avatar answered Sep 20 '22 07:09

Ravi Ram