Community
    • Login

    How to auto color specific words opening text files

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 2 Posters 705 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.
    • Ray HamelR
      Ray Hamel
      last edited by

      I have various log files, and text files with common words and errors that I grep. If possible I would like to color code those terms/errors when I open those files. Is this possible to do in NP++.

      Thanks,

      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP
        PeterJones @Ray Hamel
        last edited by

        @Ray-Hamel ,

        That sounds like a job for User Defined Languages (UDL). Basically, add keywords to the various groups when defining your language, and each of those keyword groups can have their own style setting.

        If you have an extension (like .log) that is common to all your logfiles, you can even use the UDL definition to associate that extension with your defined UDL, so Notepad++ will automatically format files with that extension using your UDL.

        More information on UDL:

        • UDL Overview = https://npp-user-manual.org/docs/user-defined-language-system/
        • UDL Details = https://ivan-radic.github.io/udl-documentation/
        • Collection of pre-made UDL definitions = https://github.com/notepad-plus-plus/userDefinedLanguages

        If you have specific questions, feel free to ask.

        Ray HamelR 1 Reply Last reply Reply Quote 3
        • Ray HamelR
          Ray Hamel @PeterJones
          last edited by

          @PeterJones said in How to auto color specific words opening text files:

          If you have an extension (like .log) that is common to all your logfiles, you can even use the UDL definition to associate that extension with your defined UDL, so Notepad++ will automatically format files with that extension using your UDL.

          Thanks Peter, this is helpful. Do you have a link or specific instructions on how to do this?

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

            @Ray-Hamel ,

            Put the extension (no dot) in the Ext entry for your UDL
            8803e092-7da9-437c-b015-913a1e356545-image.png

            That was also explained in the UDL documentation already linked.

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