• Login
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.
  • R
    Ray Hamel
    last edited by Nov 14, 2020, 11:53 PM

    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,

    P 1 Reply Last reply Nov 15, 2020, 12:32 AM Reply Quote 1
    • P
      PeterJones @Ray Hamel
      last edited by Nov 15, 2020, 12:32 AM

      @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.

      R 1 Reply Last reply Nov 15, 2020, 11:39 PM Reply Quote 3
      • R
        Ray Hamel @PeterJones
        last edited by Nov 15, 2020, 11:39 PM

        @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?

        P 1 Reply Last reply Nov 16, 2020, 12:03 AM Reply Quote 0
        • P
          PeterJones @Ray Hamel
          last edited by Nov 16, 2020, 12:03 AM

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