55

In Notepad++, when I select (eg. double-click) a "word", it gets highlighted. It needs to be separated with a non-alpha character from the rest of the text. The highlight remains until the text is selected.

Is there a way to make this highlight "permanent", ie. remain when the word is not selected any more?

Nice to have: can partial words be highlighted?

n611x007
  • 6,566
  • 15
  • 67
  • 91

3 Answers3

92

Just use the mark feature.

  1. Open the Search & Replace dialog and go to the Mark tab.

  2. Enter your search term and click Mark All.

    enter image description here

  3. All occurrences are now permanently marked:

    enter image description here

To remove the marks, simply open the dialog again and click Clear all marks.

Alternatively, while you have the word selected, you can use the Mark functionality in the Search menu:

enter image description here

This also allows you to mark all occurrences of a given string in the document (and you can even have multiple markers going on simultaneously).

Please note that both approaches work perfectly fine with partial words. In fact, multiple markers can apply to the same partial string. Here I've used a marker for port and one for mporta:

Using multiple markers simultaneously

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
15

Note: This is not permanent, all highlighting will be gone upon re-opening the file.

Steps:

  • Select your text.
  • Right-click on the text area.
  • Choose Style Token from the context menu.
  • Apply the style you need.
Saikat
  • 467
1

You can create your own language. This allows you to simply select that language for any file, without having to manually mark all words again. It will also work when the file is reloaded from the disk.

  1. Go to Language > User Defined Language > Define your language...
  2. In the Keyword Lists tab, add the words you want highlighted. You have 8 groups, each one can have a different style. Click Styler to set the style
  3. You can specify the extension of the file, so all such files will always have that style when opened, in the Ext. textbox at the top
  4. Once you're done, click Save As...
  5. To select the language for a file, go to Language, and you should see you language almost at the bottom

I use that at least with log files, where Trace, Debug, Info, ... have all a different color.