Show different theme per language?


#1

Is there a way to load a different theme per language?

I noticed that it’s already possible to do things like having different settings for the wrap guide on a language-by-language basis in config.cson:

'wrap-guide':
  'columns': [
    {
      'scope': 'source.gfm'
      'column': -1
    }
    {
      'scope': 'text.git-commit'
      'column': 72
    }
    {
      'scope': 'text.haml'
      'column': -1
    }
  ]

Anything that isn’t mentioned above has the wrap-guide at the preferred line length. Anything that is mentioned above and uses a non-negative integer as the column value displays the wrap guide after that column. Using a negative integer as the column value turns off the wrap-guide.

Seems like people want more language-specific configurations:


Different colors/themes for different projects?
#2

Saw this one too:


#3

If you mean different syntax highlighting, then yes, you can have different highlighting per language … but it essentially has to all be in one syntax theme.

The way scopes work in Atom is that they are a string of dot-separated identifiers of syntax classifications. For example, if one was looking through Ruby code, one might see the scope of keyword.other.special-method.ruby. And if one were looking through CoffeeScript, one might see the scope of variable.other.readwrite.instance.coffee.

These scopes are tagged to the text as CSS classes. So one can highlight by being very general, like matching keyword or variable. Or one can be more specific, like matching .keyword.ruby or .variable.coffee.


#4

I was thinking more in terms of just having existing themes switch based on a setting per language. So I guess more about color schemes instead of syntax.


#5

You could possibly create a theme switcher package. Though I think it would make switching tabs into a nightmare … reloading the entire CSS set every time you switched to another tab (worst case)?