Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show count of occurrences when smart highlighting in Notepad++

Is it possible to show the number of occurrences of words which are smart highlighted? I mean when you double click on a word.

In Matlab e.g. smart highlighting is activated by having the cursor touching a word and in the tool bar it instantly says for instance 4 usages of "weight" found.

Doing a search for the word/phrase will give you the same information, but how about having the count directly be shown somewhere?

BTW: Can smart highlighting be activated in a different manner than double clicking?

like image 319
embert Avatar asked Jan 06 '15 07:01

embert


People also ask

How do you count occurrences in notepad?

Open your Notepad++ by double-clicking the shortcut or searching it through the Windows search feature. Click on File and choose the Open option to open your document. Opening a file in Notepad++ Now click on the View menu in the menu bar and choose the Summary This will show you the word count of the document.

What is SEL notepad?

Currently “Sel:” shows how may letters and how many lines are selected.

How do I count unique values in Notepad++?

+\b\1\b) Click on the Count button, or hit the ALT + T shortcut.

How do you select all occurrences of a word in Notepad++?

You first need to enable this feature in Notepad++. Do this by going to Settings → Preferences → Editing and then enable Multi-Line Edit. Now when you hold Ctrl and click around your text, a cursor will be left at the location of each click.


2 Answers

You can get counts of words or matches in other ways.

The normal Find window has a Count button. If you press it, it will display the total number of items found in the status bar of the find window.

Also the Mark tab of the Find window shows the number of items found when Mark all is pressed. In addition, the items found by this kind of search are highlighted permanently.

like image 168
AdrianHHH Avatar answered Oct 04 '22 04:10

AdrianHHH


Found the answer here.

  • Download and install the python script plugin
  • Plugins --> Python script --> New script
  • Name it SelectedTextCountIntoStatusBar.py
  • Paste this, save and quit:

def callback_sci_UPDATEUI(args): if args['updated'] & UPDATE.SELECTION: matches = [] if editor.getTextLength() < 100000: # don't search "big" files if editor.getSelections() == 1 and not editor.getSelectionEmpty(): try: editor.research(r'\Q' + editor.getSelText() + r'\E', lambda m: matches.append(1)) except: matches = [] l = len(matches) notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, ' ' if l == 0 else '{} occurrence(s) of selected text'.format(l)) editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])

  • Plugins --> Python script --> Scripts --> SelectedTextCountIntoStatusBar
  • Double-click on a word
  • The number of occurrences is in the status bar.
like image 37
Henk Wiersema Avatar answered Oct 04 '22 06:10

Henk Wiersema