Which theme has the best support for Python in terms of syntax highlighting?
-
Hi,
I love the Ruby Blue theme but it has 0 syntax highlighting for python.
Which theme has the best support for python? Extensive keyword lists etc.
I’m thinking of using that as a template for modifying Ruby Blue.
Thanks.
-
@Sylvia-Ngari said in Which theme has the best support for Python in terms of syntax highlighting?:
Which theme has the best support for python?
The default theme.
-
I love the Ruby Blue theme but it has 0 syntax highlighting for python.
When I look at the source for the installer, Ruby Blue.xml definitely has the syntax highlighting defined for Python.
Oh, but looking at Ruby Blue in the Style Configurator, I see what you mean: it uses white-on-bluish-black (0x112435) for everything in Python. And a bunch of other languages.
Wow! That’s just plain annoying.
Looking at the comments, it looks like it only really has custom colors for Php, Css, Sql, JavaScript, Html, and XML. Apparently, no one ever took them up on the offer of defining colors for other languages.
Extensive keyword lists etc
The default keyword lists seen in the Style Configurator are defined by
langs.xml
, not by your theme orstylers.xml
. So all themes use the same default keyword list.I’m thinking of using that as a template for modifying Ruby Blue.
I mean, the colors would be different in one of the other themes compared to Ruby Blue, so I don’t know that basing it off a different theme is really the right idea. But you could look at the foreground colors chosen in the JavaScript and PHP languages in Ruby Blue, and use those foreground colors in similar styles in Python (for example, the JavaScript KEYWORD color could be used for KEYWORDS in Python, and similar).
-----
Once you do customize Ruby Blue, you are going to find that when v8.7 is released in a few weeks, your customized copy of Ruby Blue will be missing some new Styles for Python that are available from a fresh copy of Notepad++. Notepad++ doesn’t overwrite customized themes, nor the langs.xml, in
%AppData%\Notepad++
(because it’s trying to make sure you don’t lose your customizations), but that sometimes means you don’t have access to all the newest languages and styles for those languages – all the new entries are show in thelangs.model.xml
andstylers.model.xml
in the installation directory, but it’s tedious to replicate those to your own copies of the various themes and stylers. To automate that config-file updating, you can follow my instructions in Config Files Need Updating, Too to use the PythonScript plugin to run myConfigUpdater
script, which will look at all the languages and styles available in the*.model.*
files and insert all those languages and styles into all of your themes. -
Vim Dark Blue is my second-favorite theme (after the default) for most languages including Python.
-
@Mark-Olson said in Which theme has the best support for Python in terms of syntax highlighting?:
Vim Dark Blue is my second-favorite theme (after the default) for most languages including Python.
… but the installed version of
vim Dark Blue.xml
doesn’t come with f-string or attribute styles, so while it has more support for Python than Ruby Blue does, it’s still not complete support. (Of course, running my script would add in those missing styles with default foreground/background, at which point you can set them to whatever colors you want in the Style Configurator so that they stand out. :-)) -
@PeterJones said in Which theme has the best support for Python in terms of syntax highlighting?:
Of course, running my script would add in those missing styles…
Shameless author plug for an awesome script! :-)
-
@Sylvia Ngari
You could also try a third-party theme, like this one, which even includes a module attribute style — although it’s debatable how useful that feature really is: