Sublime Forum

Visual indicator for different workspace windows?

#1

I oftwn work across different projects and different workspaces within those projects (depending on the SVN revision).

So, for example, I might have three sublime windows open at any one time:

  1. Project Alpha, SVN revision 555
  2. Project Beta, SVN revision 345
  3. Project Beta, SVN HEAD

What I am looking for is a way to be able to visually identify these three windows quickly. For example, if I could set the file-tab bar background color to red, green, and blue for the three windows, that would work. Or if I could add text to the status bar at the bottom of the window, that’d work as well.

Any ideas on how to accomplish this?

0 Likes

#2

The background color of the tab bar is set by the theme setting, which is global to the application as a whole and can’t be customized on a window by window basis. The closest you could get is to set a custom color_scheme for all views in a window based on the revision that was in use, which would allow you to change the background color of all of the tabs themselves (and their contents), but that is not a particularly good solution visually.

It is however possible to add this information to the status line. There is an API function view.set_status() for doing this very thing. As the name suggests, the content of the status line is customizable on a view by view (i.e. file by file) basis, so you need to set it for every view that exists in a window.

An example plugin that does something like this is the one below, which demonstrates how you would go about doing something like this. In your case the text to appear in the status line would come from something other than the name of the project file in use but the concept remains the same.

1 Like

#3

Fantastic, thanks so much. I can modify the code you provided to suit my needs.

0 Likes

#4

You could also tweak the theme and associate some scripts to change theme appearance, depending on the currently activated window. But they would be tweaks specific to a theme, not global ones.

0 Likes

#5

I think that would carry too much maintenance with it. The status bar solution is simple and elegant.

Thanks for the suggestion, regardless.

0 Likes