How to make sure files save in a certain language


#1

Hello guys!

I'm quite new to Atom and after some exploring of al the different settings and functions, I've finally got myself to write something! But I immediately stumbled upon a pretty big problem for me!

I already noticed that in the right-hand corner, you can select the language you want to write in. The problem is that when I save a file, my computer doesn't recognize the language. That means that I cannot save the file as a .html or a .css file. The only way I can save my files in is of the type: file. Is there any way of manipulating this so my computer sees the files the way I meant it to be seen? I can't open HTML-files in a browser anymore and that really hurts my work speed, because I don't know exactly what I'm writing anymore!.

If anyone knows how to fix this, please help me. Thus far I'm absolutely in love with Atom! :relaxed:


#2

What platform are you running Atom on? Do you have your OS configured to hide file extensions? If you save your files with the appropriate extension for the file type you want it to be recognized as, such as .html for HTML, then things should work properly.


#3

Sorry for not responding so long.

Well, that’s the problem, I cannot set the appropriate file extensions.

I have actually found a solution, though. Before Atom, I used Code Writer. In Atom, you can select your language in the bottom right corner, but in Code Writer, you select your language before you even start typing. Because the language would be set, I could open an empty file for, let’s say, HTML, and when I would save it, all the file extensions would become available to me. If I save those files in a correct folder, I would be able to select them in Atom, so I can edit them! However, this is very inefficient, so I would love it if you found a proper solution for me!


#4

Here’s something to try: instead of selecting the file type from a drop-down menu in the Save dialog, just type it. It’s usually faster to type “index.html” than it is to type “index” and use the drop-down to select the type.


#5

I just checked, and this worked completely fine! Apart from helping me code much faster, you also learned me something new! (I may code a lot, but I’m actually not that much of a computer nerd!)

I want to thank you both a lot for helping me!


#6

No problem. My usual method is a step faster, but doesn’t work as well if you don’t know what you want to name the file initially: I right-click on the tree view, inside whichever folder I want to create the file in, and select New File. Atom will pop up a modal dialog with a prompt to name the file, and if you type something after the slash and press Enter, it opens a new tab with your file. This has multiple advantages:

  1. It doesn’t call the system dialog, so it’s faster. You don’t need the system dialog to see what’s in the folder because the tree view does that for you.
  2. The new file is automatically assigned the correct grammar.
  3. Because the method doesn’t call the system dialog, you can decide that you don’t want to make a new file and simply click anywhere else in the editor instead of having to click a button.
  4. Because it’s all text, you don’t have to click a button to create a new folder. You just tell Atom to create the file in a directory that doesn’t exist and the directory will be created for you.