Community
    • Login

    Which theme has the best support for Python in terms of syntax highlighting?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 5 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sylvia NgariS
      Sylvia Ngari
      last edited by

      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.

      Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Sylvia Ngari
        last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @Sylvia Ngari
          last edited by

          @Sylvia-Ngari ,

          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.

          ab6cad7b-42f1-4c68-a173-5e81fe889cdb-image.png

          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 or stylers.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 the langs.model.xml and stylers.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 my ConfigUpdater 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.

          1 Reply Last reply Reply Quote 1
          • Mark OlsonM
            Mark Olson
            last edited by

            Vim Dark Blue is my second-favorite theme (after the default) for most languages including Python.

            PeterJonesP 1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @Mark Olson
              last edited by

              @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. :-))

              Alan KilbornA 1 Reply Last reply Reply Quote 2
              • Alan KilbornA
                Alan Kilborn @PeterJones
                last edited by Alan Kilborn

                @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! :-)

                1 Reply Last reply Reply Quote 0
                • rdipardoR
                  rdipardo
                  last edited by

                  @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:

                  Python (Coral Reef theme)

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors