How do I tweak grammar rules for a custom file type?


#1

How do I add a new, custom file type and have it recognised by Atom?

I’m not looking to associate a custom file type with a known grammar (as in the discussion here – rather I would like to add a custom file type (save, someFile.save) and then disable certain rules for that file type inside my config.cson, for example:

“*”:
core:
customFileTypes:
“source.save”: [
“save”
]
“source.save”:
whitespace:
ensureSingleTrailingNewline: false
removeTrailingWhitespace: true


#2

You want to make a new grammar, in order to identify your files as belonging to it and give it its own config settings. The grammar doesn’t have to have anything in patterns to do what you want.