Sublime Forum

How to change the background color for specific tabs?

#1

I’m working on two similar projects at the same time.
I have 2 files on each project, with the same name:


It’s very easy to get confused about which project is currently situated, which can create problems copying and pasting information from one wrong project to another.
To help avoid this, I think it would be a great solution to have a different background color for different projects/files.
For example, in the case above, the background of all text of file1.txt and file2.txt of project 1 would be green and the background of all text of file1.txt and file2.txt of project 2 would be blue.

How to do this?

0 Likes

#2

The color of file tabs is based on the background color of the color_scheme that’s being used for that file. This is something that can be configured on a file type by file type basis, but by default that can’t be done on files based on their location on disk.

A simple plugin that applies a different color scheme to files that are stored in a specific location would allow that. Note however that the background color extends to not just the tab but the background of the file as a whole, so coming up with color scheme variations that are distinguishable but still readable can be tricky.

I’m not aware of any readily available package that would do this, although this very much sounds like something that I have helped someone with in the past on the forum. I was unable to dig it up though, so I may just be remembering previously giving the same advice.

0 Likes

#3

Thanks.
In my case, a single plugin or another solution to create individual background color per file would be enough.

Example:

  • Folder > File > Color
  1. Project1 > File1.txt > Blue
  2. Project1 > File2.txt > Blue
  3. Project2 > File1.txt > Green
  4. Project2 > File2.txt > Yellow

Any idea?

0 Likes

#4
3 Likes

#5

It was a little laborious to get the result, but following your video (and another previous one about how to configure plugins manually in ST), I managed to make the configuration work so that all files in a certain folder had a different color.

Here when I have two files with the same name in different folders:

:grinning::+1:

3 Likes

#6

Thank you, it helped me too :slight_smile:

0 Likes