t9md / atom-theme-switch

Switch theme quickly
https://atom.io/packages/theme-switch
MIT License
9 stars 3 forks source link

automatic theme switch based on extension? #1

Open leipert opened 9 years ago

leipert commented 9 years ago

I would really love a switch every time I edit markdown files.

t9md commented 9 years ago

The ui-theme and syntax-theme is global for all pane. So if you open markdown file and open another file in different tab or pane, all the syntax-theme would be affect. Is that actually what you want?

How about setting shortcut in your keymap.cson to switch theme profile quickly?

'atom-workspace:not([mini])':
  'ctrl-cmd-n':  'theme-switch:next',
leipert commented 9 years ago

Actually that is what I want. Say I have a node project. If I switch to README.md I want to switch the theme, if I go back to a *.js or whatever file, I want it to switch back.

At the moment I switch my theme every time I open a markdown file and switch back every time I navigate to another file.

If I could automate this workflow, I would save a lot of keystrokes.

I would propose the following syntax (I shortened the profiles for better readability). There are three themes installed: spacegray, light and markdown

"theme-switch":
  profiles: [
    "spacegray"
    "light"
  ],
  darkProfiles: [ ... ],
  lightProfiles: [ ... ],
  fileScopes: {
    'source.gfm': "markdown",
    'source.js': "light"
  }

So I could have the following workflow:

  1. Editing foo.html with spacegray
  2. Opening test.js -> switch to light
  3. Switching foo.html -> spacegray, trigger theme-switch:next -> light
  4. Opening README.md -> switch to markdown
  5. Switching back to foo.html -> light