prompt-toolkit / ptpython

A better Python REPL
BSD 3-Clause "New" or "Revised" License
5.19k stars 277 forks source link

[suggestion] Save a theme set using the [F2] menu + Add another example of default theme in config file #533

Open mahaaaham opened 1 year ago

mahaaaham commented 1 year ago

First, thank you for this marvelous prompt!

I would like to know if it is possible to save a choice selected using the [F2] menu, in order for it to be the default in the next launch of ptpython. In my situation, I would like to do this for the code theme (I use "dracula", that I have with Pygments)

Actually, I saw it is possible to use a config file, in .config/ptpython/config.py , but I don't know how it is possible to set a code theme as default in this file. I know I have to use Pygments for this but I don't understand how It actually works Would it be possible to put an example of this in the example config file? There is only examples of themes where colors are indicated, not the import of an existing theme, and I didn't find such an example when looking "on internet".

Thanks for your help.