Language-specific settings in Sublime Text

One feature I value in an editor is allowing different languages to have different settings. Like the way the Javascript community has settled on using two spaces for indenting, whereas Python uses four. This feature is built-in to Sublime Text. The lack of the feature is one reason I gave up on the Atom editor.

However, I always forget how to set it up in Sublime. So I’m writing it down to remember it now:

  1. Open a file containing the language you want to set per-language settings for.
  2. Go to though the menus: Sublime TextPreferencesSettings - MoreSyntax Specific - User.
  3. Enter the settings for the language. Indent spaces is "tab_size": 2, for example.

While you can create the settings file in Sublime’s settings folder directly, I find it hard to guess what a language’s filename should be, so I find using the menus easier as it sorts out the filename for you.

← Older
Understanding CouchDB 2.0 and Cloudant's indexing behaviour in a cluster
→ Newer
Using a Cloudant API Key with Multiple Cloudant Databases and Accounts