Sublime Text 2 : colour of edited file tab?

Solution 1:

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).

Solution 2:

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]
}]