How to (re-)Associate .h files with Objective-C


I would like all .h files to open with the Objective-C file type instead of the C file type.

I have tried adding this to the config.cson, but to no avail:

    '.h$': 'source.objc'

(I’ve also tried removing the dollar sign, moving it to and other things…)

I imagine that the answer lies in the file-types package, which I’ve installed, or perhaps in this exciting chronicle, but beyond that I’m just guessing as to what to change and how.



Do you have File Types installed? If so, keep in mind that you have to put all file-types under the '*' key, as indicated here.


Atom has this capability built-in now. See the FAQ:


Thank you, I tried putting

    "source.objc": ["h"]

in the config.cson, but (perhaps since it’s a file type that’s already associated) it didn’t take. Not sure what to try next.


Thanks! That worked as

    'h': 'source.objc'

under the "*": in the config.cson.