Notepad++ syntax highlighting¶
Notepad++ syntax highlighting is configured through User Defined Languages (userDefineLang.xml), allowing users to specify custom keywords, operators, delimiters, and folding rules for specific file extensions^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:33-35]. The configuration relies on the Keywords component to map logical token groups—such as directives, variables, and context identifiers—to specific numeric IDs (Words1 through Words4)^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:48-51].
For example, in an Nginx syntax definition, Words1 might list system variables (e.g., $HTTP_, $REQUEST_), while Words3 defines block contexts like http, server, or events^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:48-51]. These groups are then rendered visually by assigning Styles, which define foreground and background colors, as well as font attributes (bold/italic) for each ID^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:52-62].
Configuration Structure¶
The UserLang element requires specific settings and lists to function^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:33-35]:
- Settings: Global parameters such as case sensitivity and the character used for escaping^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:35-38].
- KeywordLists: Defines the tokens used for highlighting, including delimiters, folder open/close symbols (e.g.,
{and}), operators, and comments^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:39-51]. - Styles: Maps visual properties (colors, fonts) to the specific keyword lists defined above^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md:52-62].
Related Concepts¶
- [[Nginx]]
- [[Syntax highlighting]]
- [[User Defined Language]]
Sources¶
^[600-developer-tools-nginx-notepad-color-nginx-notepad-color.md]