Search code examples
sublimetext2

Sublime 2 -changing background color based on file type?


Using an existing Sublime 2 color scheme, is there a way to tweak the background color selectively for eg. .js files only? Many thanks!


Solution

  • You have to modify your .tmTheme color scheme plist. You can find it with menu Preferences/Browse Packages..., Color Scheme - Default directory.

    You should add something like this:

    <dict>
        <key>scope</key>
        <string>source.js</string>
        <key>settings</key>
        <dict>
            <key>background</key>
            <string>#000000</string>
        </dict>
    </dict>
    

    as a child of the settings array (of course you have to change #000000 with your color code).