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

有些话、适合烂在心里 提交于 2019-12-05 03:58:57

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:

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!