Eli
Eli

Reputation: 2696

Sublime Text 3 Tab Color Based on File Type?

I have many similarly named files in my project, e.g. 'items.create.html', 'items.create.controller.js' and 'items.create.scss', and I want to easily find the right one by simply color-coding tabs (maybe even putting custom icons?) based on the file type.

Is that possible?

Is there a package I can install? Maybe hack it on my own?

Upvotes: 11

Views: 2906

Answers (2)

sergioFC
sergioFC

Reputation: 6016

It is not perfect but the best "solution" I've found so far is to add a Syntax specific setting to change the color scheme for every filetype in which you want to have a different tab color. This is not a good solution as it also changes the background color for each filetype, so I hope someone finds a better answer.

Note 1: to add a synyax specific setting open a file (for example a .css file) and then use the menu Preferences > Settings-more > Syntax-specific. This way the settings you add will only be set for css files.

Note 2: in addition to the default color schemes, you can create your own and change the background property as you like.

Example screenshot:

Sublime text tab color based on file types example

Example settings: For javascript:

{
    "color_scheme": "Packages/User/SublimeLinter/Zenburnesque (SL).tmTheme",
}

For css:

{
    "color_scheme": "Packages/User/SublimeLinter/Dawn (SL).tmTheme"
}

For html:

{
    "color_scheme": "Packages/User/SublimeLinter/Cobalt (SL).tmTheme"
}

Upvotes: 4

HandyDan
HandyDan

Reputation: 425

Possible

The following resources will help, no packages needed

  1. Change Color Scheme Depending On File Type Open

    At the very least you can just use different themes based on the file type. Or you can duplicate your favorite theme and modify it to look slightly different.

  2. How do I change the background tab color? It's too subtle

    This resource only talks about editing the default template, but I don't see why this can't be done to any other theme (might take a some tinkering)

Upvotes: 1

Related Questions