• Login
Community
  • Login

PowerShell syntax highlighting

Scheduled Pinned Locked Moved General Discussion
7 Posts 7 Posters 15.0k 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.
  • D
    David Stein
    last edited by Jul 29, 2018, 1:35 PM

    After posting this https://notepad-plus-plus.org/community/topic/15675/powershell-syntax-highlighting/1 - I ran more tests and had others do the same. I’ve now installed every version of Notepad++ from 7.4.2 up to 7.5.8, on 27 different computers and virtual machines, running Windows 10 x64 Enterprise. Color highlighting for .ps1 files only works for the following style themes: HotFudgeSunday, Kakhi, MossyLawn, Navajo, Obisidian, Plastic Code Wrap, Solarized Light, Solarized, and ZenBurn. So this appears to be an issue with the style themes and not the language config file.

    1 Reply Last reply Reply Quote 1
    • R
      ron-g
      last edited by Aug 3, 2018, 1:29 AM

      I’d love to have PS1 highlighting in N++. I’ve noticed SublimeText doesn’t have PS1 highlighting as well. I’m stuck on the Deep Black theme, but I like Monokai as well.

      1 Reply Last reply Reply Quote 0
      • C
        Claudia Frank
        last edited by Aug 3, 2018, 11:36 AM

        What is preventing you from creating it?

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • 9
          9474757
          last edited by Sep 28, 2018, 2:53 PM

          Can You upload that files for PS? In switch prog lang i have PS, but in sett`s of style I cant see string PowerShell…

          1 Reply Last reply Reply Quote 0
          • C
            Chuck Rizzio
            last edited by Chuck Rizzio Jul 19, 2022, 8:02 PM Jul 19, 2022, 8:02 PM

            For what it’s worth… I have been running NP++ in Dark Mode and not getting any syntax highlighting for PS1 files. I don’t know what made me do this but I turned off Dark Mode and then got syntax highlighting. I turned Dark Mode back on and the syntax highlighting is still there!!! I’ll have to see if it stays working after a reboot.

            1 Reply Last reply Reply Quote 0
            • N
              Netweezurd
              last edited by Mar 17, 2025, 8:48 PM

              I’m reviving an old post as when I searched for “PowerShell highlight”, this here was the youngest post.

              We’re in 2025, after dozens of updates and I still no highlights in PS files apart from the few listed in the OP. I’m N*x so I’m Vim. No PS highlights in VIM Dark Blue.

              I figured it out.

              In AppData\Roaming\Notepad++\stylers.xml, there is a PS section.
              I just copied that section to the AppData\Roaming\Notepad++\themes\vim Dark Blue.xml. Which was my goal, PS in VIM (I’m gonna hurl) …carefully pasting it where it was between “postscript” and “props”.
              Just copy that same section to your favorite Theme!

              The colors were all shot up but they can be easily adjusted in the Style Configurator:

              NP++_Vim_PS.png

              Thank you and HF !

              P 1 Reply Last reply Mar 17, 2025, 10:07 PM Reply Quote 0
              • P
                PeterJones @Netweezurd
                last edited by Mar 17, 2025, 10:07 PM

                @Netweezurd said in PowerShell syntax highlighting:

                We’re in 2025, after dozens of updates and I still no highlights in PS files apart from the few listed in the OP.

                The Notepad++ developer only updates the stylers.model.xml and themes\DarkModeDefault.xml – he expects volunteers from the userbase to submit updates to the other themes. That’s the way it was in 2018, and that’s the way it is in 2025. When I have added languages to the Notepad++ codebase, I’ve made dummy entries in all the themes, but that’s only been a handful of the dozens of languages that have been added over time since the various themes were submitted.

                If you are willing to use the PythonScript plugin, I have a script for that plugin which will add all the missing languages to all your themes (grabbing the default colors from the theme for any new languages or new styles in an existing language – so it won’t look highlighted, but it won’t look bad); see Config Files Need Updating, Too for full details.

                No PS highlights in VIM Dark Blue.

                Indeed. As that’s not the stylers.model.xml nor themes\DarkModeDefault.xml, it’s unsurprising that it’s not updated.

                The colors were all shot up but they can be easily adjusted in the Style Configurator:

                Now that you’ve got a good set of colors for PS in the vim Dark Blue theme, you should consider submitting your update to the main repo, so that it will be bundled with future versions of Notepad++.

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