• Login
Community
  • Login

Want more user-defined keywords in Style configuration

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 2.6k 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.
  • C
    Công Cà Cuống
    last edited by Oct 5, 2017, 3:48 AM

    Hello everyone. In Notepad++/Settings/Style Configuration/Default Theme/C++ Language, there are only two styles which we can add user-defined keywords: INTRUCTION WORD and TYPE WORD.

    It is not colorful enough for me :(

    So, how can I add a CUSTOM STYLE with more user-defined keywords?

    C 1 Reply Last reply Oct 6, 2017, 1:23 PM Reply Quote 0
    • D
      decoderman
      last edited by Oct 5, 2017, 6:31 PM

      Without having tested it and with no guarantee it will work, try this:
      Close NPP.
      Find stylers.xml, mine is in the cloud on Dropbox, yours may be in the default location in Programs.
      Back it up someplace.
      Back it up someplace (intentionally duplicated).

      Open the file in NPP and duplicate the line you want to have more choice of, here I use the TYPE WORD in the <LexerType name=“cpp” desc=“C++” ext=“”> section:
      <WordsStyle name=“TYPE WORD” styleID=“16” fgColor=“8000FF” bgColor=“FFFFFF” fontName=“” fontStyle=“0” fontSize=“” keywordClass=“type1” />
      <WordsStyle name=“TYPE WORD” styleID=“16” fgColor=“8000FF” bgColor=“FFFFFF” fontName=“” fontStyle=“0” fontSize=“” keywordClass=“type2” />

      Notice the type2 class name I have boldly chosen.
      Save and close NPP, start it up again and edit the second instance of TYPE WORD in NPP.

      It may work…

      1 Reply Last reply Reply Quote 0
      • C
        Claudia Frank @Công Cà Cuống
        last edited by Oct 6, 2017, 1:23 PM

        @Công-Cà-Cuống

        as you do cpp programming, the sources which needs to be checked are, in your case,
        LexCPP.cxx and ScintillaEditView.cpp.
        The lexer defines what is supported at all and within ScintillaEditView you see what/how npp
        uses it.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • C
          Công Cà Cuống
          last edited by Oct 11, 2017, 5:57 AM

          @ decoderman

          I have tried your solution, but this field styleID=“16”, it seems to be conflicted :)

          It did not word for me :(

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