How coding language is automatically set when the file is opened?


Recently,I used the hexo to write blog, in the hexo,the template file’s suffix name is .swig, css file’s suffix name is .styl, when open these two kind of files with Atom, there is no code highlight, the code is all gray,here are the pictures:

Later set the programming language with ctrl + shift + L, the .swig file programming language is set to html, .styl set to css:

Attributes and values will have different colors, it looks more convenient.

How to set .swig file after the open programming language automatically set to html and .stylfile to css?
Thank’s a lot. :slight_smile:


Please see the FAQ:


I am sorry to understand, can tell me directly in config.cson with what code to meet my requirements ?:slight_smile: