How to mimic Python commenting for personal file type


#1

I have my own file type “.inst”, that currently edits in plain text for Atom.

Comments in my files are done exactly like Python’s, with a # signifying the beginning of a line comment.

How do I get the ctrl-/ command to comment out lines in my files, the same way it does for Python files?


#2

You can do it by creating your own language package and telling it what the comments should look like in the language-specific settings. Once Atom has that information, the ctrl-/ command will be unlocked. You can look at some of the small language packages I have on GitHub and the official packages for reference, and if you have any questions I can answer them.


#3

For now, I think I’m just going to literally treat it as a python file: https://web.archive.org/save/https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539