Can Kate (the text editor) display the number of times that a search term a user has entered in Find/Replace appears in a document? - kate

Chromium, for example, displays the number of times that a search term a user has entered in Find appears on a web page.
My use case is simple: when I search in Kate I would like to know how many times my search term appears in the document I am searching.

Yes: Switch to Search & Replace mode via Ctrl+R and click on Find All. Then a popup will appear displaying the total number of found matches.

Related

intelliJ -> is there any way to scope your search to be within a function

Very often while coding, I need to search for keywords which are common and happen throughout a large file, but I am looking for an instance within a function.
The default search functionality often gives me all results starting from the top. Is there any way/workflow to search only within a specific method/function or block of code?
Update
Do Ctrl + F
Then Ctrl + Alt + E
Type the text to search
On MacOS, it's cmd instead of Ctrl
Original Post
You can do it like this (mentioned keymaps are for Linux):
Let's take as an example the following code, where we will be searching for the word "key" inside the method "clear". As you can see there are many occurrences of that word (in red, highlighted the ones we want in our results, and in blue other occurrences, which we do not want to appear in our search results)
1- Select the area you want to limit the search scope to.
2- Press Ctrl+Shift+F. It will pop up a search window with the selected text pre-filled in the search box.
3- Select the options "Scope" and, in the combo next to it, "Selection" (if they are not selected by default)
4- Type the word(s) you want to search (in this example, the key word).
5- The results shown will be limited to the selected area. Notice how there are only 9 matches in the upper right corner ("Match case" option is checked), despite in the same file there are many other occurrences of the same word.
However, I was neither able to find a key combination in order to do this as a single action nor assign a new one. Also, notice how the search includes the text in the method documentation.
Tested using IntelliJ IDEA 2018.1.4 (Ultimate Edition), Build #IU-181.5087.20 on Ubuntu 18.04
Looks like we're finally getting this feature in IDEA 2019.3:
https://blog.jetbrains.com/idea/2019/09/whats-new-in-intellij-idea-2019-3-eap-2/ (Ctrl-F for subtitle "Ability to search in a selected area when using the Find action")
It’s now possible to search only in a selected area using the Find action (cmd+F / Ctrl +F). Simply select the code piece you need in the editor and invoke the Find action and the IDE will perform the search only in the selected area.
Screenshot from the article (was a GIF originally)
There is a way to search inside a method, however, it doesn't seem to work for other scopes.
When searching in file as usual, click "Find all"
You'll get a list of results in the bottom panel. If you enable "Group by file structure" (I had it disabled by default), you can get a list of matches for a particular method.
On IntelliJ in Mac:
In a file select the specific block in which we want to find
something
Press CMD + F
Press CTRL + OPTION + G
Notice that the cursor has automatically landed in the find toolbar's text field
Type in what is intended to be found
Press enter to move the cursor
to the first occurrence.

Search the formula content in Google Spreadsheet

What I mean in the title is if I want to looking for just only the part of formula's word such as =ArrayFormula( in one hit from the menu bar like Search > Formula.
When pressing Ctrl+F the search dialog appears
Clicking on the three dots makes a dialog appear.
By default formulas' contents are not searched
Ticking "Also Search within Formulae" will change the display of all cells containing formulae and search those too.

Excel VBA save/restore last search term

Is there a way to save/restore the last (user defined) search term when using the Cells.Find method in Excel VBA?
Example:
The user is searching for "foo" with the find dialog (CTRL-F).
Later he can repeat his search by simply pressing CTRL-F and ENTER. (The search term will still be there.)
But if a macro uses Cells.Find to search for "bar", the search term will be replaced.
Now the user can not simply repeat his search for "foo" anymore because the find dialog is starting with "bar" as search term.
Maybe the user has even forgotten which word or number he was searching for at the last time? In this case the old search term in the dialog box would be very helpful.
My solution for Word is simple:
' // Save the last user defined search term.
strSearchTermBackup = Selection.Find.Text
With Selection.Find
.Text = "bar"
[...]
End With
' // Restore the last user defined search term.
Selection.Find.Text = strSearchTermBackup
Unfortunately this seems not to be possible in Excel. I get only compiler errors like "argument not optional".
Do I miss something very simple here?
Thanks in advance
You may be re-inventing the wheel ...
The Find & Replace Dialog Box stores history for you. Just click the drop-down arrow to the right of the text entry box. There a user can grab several search executions worth of history.

Visual Studio 2012 - Keeping the search box open when switching between files

Not a fan of the "updated" search box in VS 2012. When I perform a search, I'd like to keep that search box visible as I'm clicking through my file tab well. Right now, it seems like the search box can only be visible for one file at a time.
For example, I'm have 2 files open. I search for the word "eyepatch" in the current file. I next want to perform this same search on the next file. But when click on the next file, the search box disappears and I have to do a ctrl + f and type "eyepatch" again.
Anyone know how to make this easier?
Hit F3 (Find Next). It keeps the search text from the previous search upon next invocation.
Select [All Open Documents] from the drop down menu at the bottom of the Search Box

Safari web inspector next match?

I am searching my Javascript file for certain text. I entered that text into the search box, and it helpfully tells me that there are four matches. So far, so good. But how can I go to the next/previous match?
Just hit Return and Shift-Return.

Resources