Programs » Sublime Text

Add Extension to Predefined Syntax

If you have a file with an extension unknown to Sublime Text it is possible to add this extension to any syntax patterns which the editor has by default.

1. Go to View -> Syntax -> Open all with current extension as…
OR in the right down corner press Plain Text -> Open all with current extension as…

2. Also you may create a settings file to include the extension.

2.1. Go to Packages/User folder.

2.2. Create a file [ext].sublime-settings, where [ext] – is one of the predefined extensions (js, html, css, ini).

2.3. Put this contents:

{
  "extensions":
  [
    "[new-ext]"
  ]
}

where [new-ext] – is your new extension without dot.

2.4. Restart Subilme Text.

Example:
You have a file test.abc and want it to have JavaScript syntax.
Create a file JavaScript.sublime-settings and put

{
  "extensions":
  [
    "abc"
  ]
}

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>