Community
    • Login

    Want more user-defined keywords in Style configuration

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 2.5k 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ông Cà CuốngC
      Công Cà Cuống
      last edited by

      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?

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • decodermanD
        decoderman
        last edited by

        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
        • Claudia FrankC
          Claudia Frank @Công Cà Cuống
          last edited by

          @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ông Cà CuốngC
            Công Cà Cuống
            last edited by

            @ 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
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors