Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use different themes based on file type?

Tags:

atom-editor

Is it possible to have themes run based on the type of document?

For example, I'd like to have one theme for .js, .html, another for .md files.

like image 478
garrilla Avatar asked Oct 08 '14 08:10

garrilla


2 Answers

This is no longer the correct answer, please see the other answer for a package that allows you to do what the question asked. I tried to delete this answer, but can‘t do it, since it‘s the accepted answer at the moment.

No, this is currently not possible.

Atom uses two themes: The UI Theme determines the overall layout of the editor, including tabs, the tree view and and all other visible areas - is this really what you want?

The Syntax Theme determines the colors used for displaying text and highlighting based on the syntax. There's currently no automatic way for switching the syntax theme based on the selected file's language.

Having said that, you could probably write a package to do that. Please be aware that switching between themes takes a couple of moments, I don't know how practical it would be to switch the whole theme based on the file type.

There's a couple of packages that switch between themes or to a random theme every couple of minutes or based on a keypress, you could probably use one of these as an example if you want to build your own:

  • https://atom.io/packages/theme-roulette
  • https://atom.io/packages/theme-switcher
  • https://atom.io/packages/switcheroo
like image 131
nwinkler Avatar answered Nov 16 '22 04:11

nwinkler


Have you tried multi-theme-applicator? It seems to work well for me! As long as you have atom > 1.13 it should work. Here are the links to the atom.io documentation for this package, as well as the github page.

https://atom.io/packages/multi-theme-applicator

https://github.com/vt5491/multi-theme-applicator

like image 4
Sneaky Toes Avatar answered Nov 16 '22 03:11

Sneaky Toes