Matt Karssen
Matt Karssen

Reputation: 1

Atom IDE Default Language Syntax Highlighting

I'm pretty new to programming and have started using Atom for coding. I want to make python the default for code color highlighting so I don't have to change it every time I start a new file, but I haven't found out how to do that yet. I have a couple screenshots of what I'm talking about.

The first is a screen-grab from the bottom right corner, and the second is the window that comes up when that is selected. It shows python because I have already changed it for this file. I would like python to be the default.

Screen Grab 1 Screen Grab 2

Upvotes: 0

Views: 687

Answers (1)

Finley Siebert
Finley Siebert

Reputation: 23

Depending on what OS you are using you can go do this:

macOS: Atom -> Init Script

Windows: File -> Init Script

This will make a window appear that is titled init.coffee

Then underneath the commented section add these lines of code:

atom.workspace.observeTextEditors (editor) ->
   unless editor.getPath()
       editor.setGrammar(atom.grammars.grammarForScopeName('source.python'))

Save and restart Atom.

source: here

Upvotes: 1

Related Questions