I was trying to find a way to highlight a selected block of code in Notepad++ like Microsoft Word allows you to do for a document. Is this possible?
2 Answers
To highlight a block of code in Notepad++, please do the following steps
- Select the required text.
- Right click to display the context menu
- Choose Style tokenand select any of the five choices available ( styles fromUsing 1st styletousing 5th style). Each is of different colors.If you want yellow color chooseusing 3rd style.
If you want to create your own style you can use Style Configurator under Settings menu.
 
    
    - 3,201
- 2
- 23
- 28
- 
                    I can see it in version v6.5, but not in version v5.8.7 on Windows. – Thomas Jan 30 '14 at 10:19
- 
                    5the problem is that if you highlight the text with text say for example "Integer.valueOf()" wherever you have "Integer.valueOf()" in your entire code it is highlighted. How do you highlight something just at one place? – Bhushan Feb 01 '14 at 03:46
- 
                    4also those styles aren't permanently saved – Bhushan Feb 01 '14 at 03:55
- 
                    10Be careful that Notepad++ is a text editor not a word processor. It just save the text as it is. It means you cannot save your highlights in the file. – Arashsoft Aug 26 '16 at 15:49
- 
                    In short, This is not a permanent highlight – ASharma7 Nov 19 '19 at 10:16
"Select your text, right click, then choose
Style Tokenand then using 1st style (2nd style, etc …). At the moment is not possible to save the style tokens but there is an idea pending on Idea torrent you may vote for if your are interested in that."
It should be default, but it might be hidden.
"It might be that something happened to your
contextMenu.xmlso that you only get the basic standard. Have a look in NPPs config folder (%appdata%\Notepad++\) if thecontextMenu.xmlis there. If no: that would be the answer; if yes: it might be defect. Anyway you can grab the original standart contextMenu.xml from here and place it into the config folder (or replace the existing xml). Start NPP and you should have quite a long context menu. Tip: have a look at thecontextmenu.xmlitself - because you're allowed to change it to your own needs."
See this for more information
 
    
    - 24,871
- 12
- 85
- 147
 
    