One thing I like to do is to have different themes for different file types in my text editor. That way, at a glance, I can guess what kind of file a text-filled window contains, especially when zoomed out using Mission Control. I’ve been using Custom Language Preferences in BBEdit preferences to set up the color scheme for each file type there. TextMate 2 users, check out Multiple Themes in TextMate 2.
But how to do this in Sublime Text 2?
To achieve this, first install all the themes you may need. Obvious, I know!
Then set the default theme using Preferences / Color Scheme from the Sublime Text 2 menu. This sets the theme in the default preferences file which resides in ~/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings.
The theme line looks like this in the file:
1 2 3 4 5
Next, open a file type where you would like to use a different theme, for example, open a Markdown file. It will open using the default theme. Now choose Preferences / Settings More / Syntax Specific – User from the Sublime Text 2 menu. Sublime Text 2 will create a new settings file with the selected file type as its name (in my case, the markdown settings file is Markdown.sublime-settings). If the file already exists, Sublime will open it for editing.
Set the theme in this file, as well as any other settings you like for that file kind. For example, my Markdown.sublime-settings is:
1 2 3 4 5 6
You may need to restart Sublime Text 2 after this.
Next time you open a file where you have set type-specific user settings, the theme specified will be used. Nice!