Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom Code Editor. Why is my code not in color?

Tags:

atom-editor

I started using the Atom Code editor recently. During my last project, I installed a couple of tools to make my coding more interactive.

One of the features added color to my code which makes it easier to read.

However, I started a new project today and the code is all white on a dark background. How do I color my code?

I have attached two screenshots of the colored code and the non colored code just to illustrate what I mean but its pretty straightforward.

like image 745
Aron Tesfay Avatar asked Jul 29 '17 00:07

Aron Tesfay


4 Answers

Atom might not be recognizing the syntax of your code immediately. Check the bottom right corner of the screen to make sure atom has the correct language/file extension selected. You can manually select this if atom doesn't do it automatically. You might also need to install some new packages if atom isn't recognizing your code.

like image 70
Zubair Avatar answered Oct 08 '22 22:10

Zubair


Use ctrl+shift+l to open the language selector, and select the auto-detect option.

like image 21
Swetha J Avatar answered Oct 08 '22 22:10

Swetha J


I had the same problem. Try switching to HTML(Go) in the bottom right corner. It's between UTF-8 and Github.

like image 9
Moose LT Avatar answered Oct 08 '22 20:10

Moose LT


The current version of Atom I'm running as of Oct 2018 seems to identify code by tags. So even if I select HTML manually, unless the file has <html> tag, it still doesn't mark it as HTML. I just add redundant commented out <!-- <html> --> tag in the beginning of the file and it does the trick.

like image 3
Arthur Tarasov Avatar answered Oct 08 '22 22:10

Arthur Tarasov