Community
    • Login

    How to set a global comment style?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 528 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.
    • PaulStSmithP
      PaulStSmith
      last edited by

      I’ve searched but could not find anything related to this.

      How do I set a default comment (or keyword, or whatever) text style (font, font-style, color, etc.) style for ALL languages at once?

      I know how to set for one specific language, but I’d like to be able to set one style for the entire N++ and than go language by language.

      Thanks in advance.

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

        @PaulStSmith ,

        The reason you could not find it documented anywhere is that there is no easy way to do that. One of the problems is not all the COMMENTs (for example) have the same style ID or same exact name in every language; and not every language has a COMMENT. (It’s one of the reasons that designing a whole style takes effort, rather than just a couple quick tweaks.)

        If you wanted to change something like that, you could open up %AppData%\Notepad++\stylers.xml and do a series of regex-based search-and-replace like

        • FIND = (?i-s)(name="COMMENT.*?fgColor)=".{6}"
          REPLACE = ${1}="XXXXXX"
          SEARCH MODE = Regular Expression

        (that will replace the foreground for any style name that starts with COMMENT with the color XXXXXX of your choice)

        You would then have to do that for every style name that is reasonably consistent throughout all the language style definitions.

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