Conditional color scheme in Sublime Text 2

In my workflow, I manage two sets of code for each website project. One for live code, and the other for code that still runs.

I would like different color schemes to be developed for live files and intermediate files so that I can easily distinguish them.

Is there a way to change the color scheme in Sublime Text based on the path to the file directory?


For instance:

  • /live/style.css has the style Packages/ColorSchemes/ColorScheme_1.tmTheme
  • /staging/style.css has the style Packages/ColorSchemes/ColorScheme_2.tmTheme
+5
source share
1 answer

I wrote a simple plugin that met your initial requirements, and then added a few extra features, as it might be useful to others as a release.


The plugin uses RegEx to ensure compliance:

  • File Names (Full and Partial)
  • Extensions
  • Parent Directories
  • SubDirectory Structures

Some examples:

Way

Filename


Get the plugin:

@PackageControl

@GitHub

+1
source

All Articles