No colours in editor


#1

Hey guys,

so now I’ve been using Atom for a few days and until yesterday my commands in .txt files got coloured when typing i.e. “#” or “*”. Now it just stays the same colour all over. .md files work properly, but I would love to get the colour also back in .txt. files.
What did I wrong? I’m sure it’S my fault but I can’t find a solution.
Thank’s in advance :slight_smile:

My Atom Version:1.17


#2

.txt files should be colorless, unless you’ve told Atom to do something different with them. You can configure Atom to match them as markdown, if you want.


#3

Hm, what did I do to make it colourful the first days because I swear it has always been a .txt file :sweat_smile:.
Thanks for your quick respond, may you tell me what to fill in the blankets? (I’m sorry for asking dumb questions, mechanical engineer here - who, as you definitely can tell, has very little knowledge about programming, but really likes the interface of the program :slight_smile: ).

customFileTypes:
  '_something txt_': [
    '_something md_'
  ]

#4
'*':
  core:
    customFileTypes:
      'source.gfm': [
        'txt'
      ]

You can find the scope of a grammar either by looking at the settings pane for that package in the editor, or by looking at the source code on GitHub. In a CSON document, you can’t have any duplicate keys, so when you’re implementing a description like the one above, merge it into any existing hierarchy. Preserving indentation is the most important part, as that’s how the program identifies the hierarchy.


#5

Ah, good to know.
Thank you very very much for your help!


#6

@DamnedScholar The plain text grammar actually does define some scopes for bullet points (https://github.com/atom/language-text/blob/master/grammars/plain%20text.cson). @Firamis can you try using the editor:log-cursor-scope command and tell me if the scopes are reporting as text.plain.null-grammar or text.plain?


#7

Ooo. I stand corrected.


#8

Hey Wliu, thank’s for your time. Unfortunately neither of them as you can see in the picture. (the colors come from the code above)


#9

In order to do this you’ll have to temporarily comment out what @DamnedScholar told you to put in your config.cson.


#10

Sorry!