When you’re writing code, you want your development environment to have the flexibility to work with any of the programming languages you may use. One feature that can be particularly helpful is called “syntax highlighting”. Syntax highlighting applies a range of colours to key syntax depending on the language being used.
Tip: Syntax is a set of rules that describe the structure of a language. The syntax can vary heavily between languages.
There at 87 pre-configured languages in Notepad++, it also includes functionality for you to add new language definitions or to define your own language.
Tip: Syntax highlighting, applies to the whole document, it’s not possible to configure a section of code to use a different set of syntax highlighting rules.
How to configure the syntax highlighting
To configure syntax highlighting in a document, click on “Language” in the top bar. Next, select the first letter of the language you’re coding in, then the exact language from the second level of the drop-down menu.
If you want to define your own language, click on “Language” again, then click on “User Defined Language”, third from the bottom, and then click “Define your language”. In the “User Defined Language” window, you can enter the details needed to define your language. Full documentation is available at the “Documentation” link in the top-left of the “Folder & Default” tab.
Alternatively, if you open or save a document with a supported file extension, Notepad++ will automatically apply the syntax highlighting for the appropriate language. For example, if you save a document with the file extension “.c” for C code, then Sublime Text 3 will automatically enable the syntax highlighting for C code.
Tip: To disable syntax highlighting, select “Normal text”, listed under “N”, from the supported language list.
Vinod KC says
I have Nim language source file in notepad++. But I want to change some colors. Not full colors. String and comments only. If I use Style Configurator, I can change the colors but notepad++ won’t save that changes in xml file. So I loss all that changes I made. How to prevent this.
No. When I am trying to create !DOCTYPE html the auto tag replaces the text with a dark highlight and I can not continue or read without the highlight/background on and I am unable to see remoe it