Can you use multiple color schemes for different languagues in Atom?


#1

For example in Sublime I use Monokai for HTML, Dracula for SASS and Tron for JS.

Is this possible in Atom? I finally figured out how to save the state of my last folders… you have to open atom via the terminal atom . So now that I can finally use it :slight_smile: Figured next thing is colors hehe…


Using different syntax theme for different grammars?
#2

There’s no built in support for that. Perhaps there’s a package that does that, or you could write one?


#3

It’s definitely possible (in theory, with the current API), although I don’t know of any theme or package that implements it. I’ve thought about adding this to my own theme (base16-syntax), but dismissed it as something noone would want. Perhaps I should reconsider it. The hardest part would probably be figuring out a nice way to make it configurable in the Settings UI. Ideally you’d like to have a Language Specific part, with a dropdown menu for language, color scheme and style. If one language specific setting is configured, an empty one appears, and so on. I don’t think this is currently supported in Atom, so having 3 arrays (one for language, color and style) that together represent a list of triples will also work, but it is ugly, user unfriendly and error prone.

I also have a feeling this should be possible within init.coffee, to load whatever theme package based on grammar.


#4

Does someone know if the situations around using different styles/themes for different syntax/grammar has changed?

I’m trying to transition from Sublime and a separate syntax highlighting for Markdown is very important for me. My coding theme is light text on dark background, my Markdown/Writing theme the other way around and uses a different font.

Is this feature in consideration or are there community packages to achieve it?


#5

There’s no built-in support in Atom for having a drop-down that selects different syntax themes for different languages. It also isn’t something that we’re planning on implementing soon.

On the other hand, as @Alchiadus mentioned, you can have completely separate syntax color schemes by language currently. Every scope in Atom includes the grammar of the scope … like string.quoted.single.js. Since most people want all strings to show up the same across all languages, they simply specify string in their syntax theme and they’re done. But if you want strings to look different in JavaScript versus other languages … you could use .string.js to specify something different specifically for JavaScript.