Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional color scheme in Sublime Text 2

In my workflow, I manage two sets of code per website project. One is for live code and the other is for code which is still being staged.

I would like for live files & staging files to be styled by different color schemes so that I can easily differentiate them.

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


For example:

  • /live/style.css is styled with Packages/ColorSchemes/ColorScheme_1.tmTheme
  • /staging/style.css is styled with Packages/ColorSchemes/ColorScheme_2.tmTheme
like image 296
Shannon Smith Avatar asked Nov 08 '22 15:11

Shannon Smith


1 Answers

I wrote a simple plugin that met your initial requirements and then ended up adding a few extra features since it could be useful to others as a release.


The plugin utilizes RegEx to allow matching of:

  • FileNames ( full & partial )
  • Extensions
  • Parent Directories
  • SubDirectory Structures

Some Examples:

Path

FileName


Get the plugin:

@ PackageControl

@ GitHub

like image 135
Enteleform Avatar answered Jan 04 '23 03:01

Enteleform