How to auto color specific words opening text files
-
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,
-
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.
-
@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?
-
Put the extension (no dot) in the Ext entry for your UDL
That was also explained in the UDL documentation already linked.