Spyder: Export/share color scheme

Created on 17 Feb 2015  路  19Comments  路  Source: spyder-ide/spyder

_From [email protected] on 2013-07-21T09:58:29Z_

Please note that reporting bugs from Spyder's help menu ("?" > "Report
issue...") will fill version details for Spyder, Python and Qt in this description for you. I spent some time making the editor's colors as similar as possible to the Monokai color scheme on the 'Spyder' installed in my PC. Now I'd like to make the one installed in my laptop look the same but there's no option to export/share the custom color scheme.

I know it's a very minor issue but it'd be nice to be able to share color schemes among users.

_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1493_

1 star Help wanted Preferences Enhancement future

Most helpful comment

Related to this...I was working on a spyder-themes cli that would allow users to install multiple or specific available color-schemes. However, I'd be interested in working on something like this that allowed not only the exporting of syntax color schemes but also the importing of them.

All 19 comments

_From ccordoba12 on 2013-08-09T12:45:33Z_

You are totally right! I also would like to have this feature but I don't have time to do it right now.

I'll try to do it in 2.4 :) Thanks for your patience.

Status: HelpNeeded
Labels: -Type-Defect Type-Enh MS-v2.4 Cat-Editor

@ccordoba12 do we have a export format in mind?

Nop, we don't have one.

We should use a standard one. I have no idea which. Maybe the same as sublime text ?

@blink1073, do you know Sublime's format?

I see no syntax highlight in there...

That is a color scheme for the whole interface... we can also do that... but not what we wanted for this thread.

Yeah, I added a comment when I understood my confusion but it seems it wasn't validated. The network is really bad at work these days :(.
I never heard about a common format for color definitions.

We could just spit it out in the same format Spyder uses internally in spyder.ini; that would be simplest. We could also use css, xml, json etc. like some editors.

I think json is the easiest.

Related to this...I was working on a spyder-themes cli that would allow users to install multiple or specific available color-schemes. However, I'd be interested in working on something like this that allowed not only the exporting of syntax color schemes but also the importing of them.

We'd definitely love your help @sdhutchins ! That would be fantastic.

@sdhutchins, it shouldn't be that hard. We were thinking to use Json to import/export themes.

@ccordoba12 Will the .ini remain? If so, it just seems it'll be a matter of 1. building a button 2. parsing json 3. editing the .ini file for at least importing. Similar for exporting.

It has to, at least to store all Spyder's other preferences...

@CAM-Gerlach Just making sure that wasn't going to change in v4.

Will the .ini remain?

Yep, that's not going to change anytime soon.

Are there any plans to implement color scheme import/export in 2020, now that v4 is out? This might be complicated by #5790, but the existence of SO questions and this possibly defunct as of Spyder4 repo seem to indicate an ongoing desire for the feature.

I've also found that the "selected" field in spyder.ini does not seem to match up to my custom (created through the GUI) theme in Spyder4, nor does my custom theme appear anywhere else in that file, as far as I'm aware. Does Spyder still use the spyder.ini file for (custom) color schemes? If not, is it possible for me to find where my custom color scheme is stored for a manual export? Would really love to avoid losing/having to type all those hex codes back in manually whenever I reinstall.

Thanks for asking. @ccordoba12 would know if there's any plans. It would definitely be a very useful feature; I planned to implement it myself at some point if someone else didn't but never got the time. However now that the Spyder 4 default theme is largely based on a combination of a refined version of my own custom theme I created and used previously, and the Atom theme which was incidentally very similar to it (and was one reason why it was chosen), it hasn't been as big an issue for me personally.

This might be complicated by #5790

Actually, not really, its a bug that needs to be fixed though I've tracked it down, I just needed to trace the code to figure out what triggered it. This was actually proposed as a way to mitigate most of the harms of that bug.

this possibly defunct as of Spyder4 repo seem to indicate an ongoing desire for the feature.

That script doesn't really have anything to do with this feature; it provides a way to convert Eclipse color themes into Spyder color schemes, not anything directly to do with import and export.

I've also found that the "selected" field in spyder.ini does not seem to match up to my custom (created through the GUI) theme in Spyder4, nor does my custom theme appear anywhere else in that file, as far as I'm aware.

If you've upgraded from a Spyder 3 install, what you're probably seeing is the old spyder.ini file in the root .spyder-py3 directory that is no longer used; the active spyder.ini file is now stored in the config/ subdirectory. Your themes will be there, and you can add/remove them by simply copying and pasting all the relevant keys and adding/removing them from the list.

Would really love to avoid losing/having to type all those hex codes back in manually whenever I reinstall.

Yeah, this was a massive hassle for me, by far the most important thing I'd loose with my config, and a major frustration whenever my config directory was reset as it sometimes was when developing Spyder. Eventually I just kept lots of backups just for my color themes, although now I just use the default since its pretty close to the original custom theme I developed due to being partially based on it, but obviously this is still a major problem for anyone else and it would be great to have a UX better than just copying and pasting from a config file. It wouldn't be hard to impelement, most of the work would just be building the GUI I'd think.

@ccordoba12 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cchu08 picture cchu08  路  3Comments

danieltomasz picture danieltomasz  路  3Comments

keith-golden picture keith-golden  路  3Comments

hedeqing picture hedeqing  路  3Comments

Khalilsqu picture Khalilsqu  路  3Comments