How do I make Atom recognize a file with extension X as language Y?


#1

Atom includes a feature called “custom file types” which you can use by adding some entries into your config.cson that look like this:

core:
  customFileTypes:
    'source.ruby': [
      'Cheffile'
      'this-is-also-ruby'
    ]
    'source.cpp': [
      'h'
    ]

The key (for example source.ruby in the above snippet) is the language’s scope name. The value is an array of file extensions, without the period, to match to that scope name.


Edit/Set File Associations
Recognizing different file extensions (.zmc)
Modifying language-c for C++ Syntax Highlighting
Rails syntax by default?
Is there a package that support Smarty templates syntax inside *.smarty files?
Auto-detect Markdown as language for .txt files?
How to (re-)Associate .h files with Objective-C
Using customFileTypes to change the language for HTML
How to turn on / change language syntax highlighting
How coding language is automatically set when the file is opened?
How to add other files for tags?
Using customFileTypes to highlight .rules as xtend
Snippets for custom file
How to add php syntax highlighting to a .theme file?
[Solved] Default scope names
Using customFileTypes to highlight .rules as xtend
How do I tweak grammar rules for a custom file type?
Python and not Python (Django) as default