Background color change of found text in notepad++ - colors

when i search a text pattern using "find all in current document" option in Find window, how to set the background of the selected result. Like currently i am searching "I" in the complete file, need the search result background to change when i select a particular line.
attaching a snapshot of same.

Settings > Style Configurator
Under Language find "Search result" (on my notepad++ this is the one at the bottom)
Under style change as wished

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.

Find and replace within selection in sublime text 3?

I've read this thread indicating how to find and replace within selection in ST2. Despite reading this thread but still cannot figure out if it's possible to do a simple find and replace within selection in ST3?
Ensure the find and replace panel is closed.
Select the text in which you want to perform the find/replace - i.e. define your selection.
Open the Find/Replace panel - if desired, you can use a keybinding to run the show_panel command by going to preferences -> keybindings, then adding this line to the user keybindings: { "keys": ["ctrl+shift+s"], "command": "show_panel", "args": { "panel": "replace", "in_selection": true } } to ensure that the "in selection" mode is active and skip the next step. (see the forums for more available args.)
Turn on "in selection" mode if it is not already active by clicking on the button in the panel.
Enter your find/replace terms and perform your find/replace
If you want to change the selection you are searching within, you will need to close and re-open the panel.
If the region/selection you are searching within always contains multiple lines, you may want to consider setting the following preference for convenience:
// When auto_find_in_selection is enabled, the "Find in Selection" flag
// will be enabled automatically when multiple lines of text are selected
"auto_find_in_selection": true,
Select the word by pressing CMD+D it selects 1 from whole file and show transparent selection of all related word you can press more times CMD+D for selecting all word then edit it all words take places
You can (using ctrl-h, then toggling the 'in selection' option from the dialog), but it's a bad design IMO. Firstly, if you have an area of text highlighted when you request 'replace', it should assume "replace in selection" automatically. Secondly, as soon as you choose 'replace' it thoughtfully cancels the text selection for you. The whole process ends up involving cumbersome repetition, or an illogical sequence of steps. Visual Studio gets the UI design right; Sublime does not.
Searching and/or replacing within only a selected area in Sublime is indeed possible.
If you have text selected, once you open the Find or Replace panels, you can select the button for Find in Selection (which is turned off by default unless you have the auto_find_in_selection turned on and select multiple lines) to have the operation you carry out only apply to the selected area.
In this example I'm doing the following:
Pressing Alt+F3 to select all instances of the word to, showing how many of them there are
Select the first paragraph and then open the Find and Replace panel with Ctrl+H
Turn on the option to operate within the selection
Replace all instances of the word to with the word FROM
Show that the instances of to outside of the selection are still there untouched.
Select the line/word/code and Press Ctrl+d.
Matched piece of text will be selected and will have cursor after them.
You can edit them together.
Ctrl+h is the shortcut for 'Copy and Replace' in all versions of Sublime.

Background color, notepad++ for highlighting purposes

Is there a way in Notepad++ to highlight a snippet of text and change it's background color? I would like it to remain that color within the editor for highlighting purposes. I don't want the color to change the code at all.
You can get the effect you want by right-clicking on the highlighted snippet and selecting "Style token" -> "Using (n)th style".
This will also highlight any other sections of your code which are identical to the one you selected, which may or may not be what you want. However the highlighting will only remain for as long as you have that file open in notepad++. If you close it, you will lose the highlighting.
In Notepad++
First select the line/words to be highlighted
Go to 'Search' Menu
Select 'Mark All'.
There you will find 5 sub-menu as 'using [1..5]th style'.
(using 1st style : cyan colour) .
(2nd : light brown) .
(3rd : yellow) .
(4th : purple) .
(5th : green) .
However the highlighting will only remain for as long as you have that file open in notepad++. If you close it, you will lose the highlighting.
You can also define a language that set the snippet as a keyword and choose style for it.

In Visual Studio, how can I change/disable the line-highlight color when I double-click on a row in "Find Results"?

Sorry for the complicated title.
Screenshot here:
Basically:
Do a "Find in Files" search in VS.
Double click on one of the results.
The line in the editor window is highlighted with dark blue (in my case).
The highlight does not go away unless I do another "Find in Files" search and click on another result.
The problems:
The highlight is too dark/overpowering.
I can't see other highlights (like selecting text, or even where my cursor is).
I want the highlight to go away while I'm editing the file.
So my questions:
Can I change the color of this highlight to something less powerful? (a nice light gray perhaps) I can't seem to tell which of the color-coding options changes this one.
Can I clear this highlight somehow while editing (without needing to do another search)
Can I disable this highlighting completely?
Thanks!
PS. I'm not interested in the line-highlight color in the "Find Results" window itself - just the highlight that appears in my text-editor window after I double-click on one of the results.
Try changing your color settings.
Tools -> Options -> Fonts and Colors
Select "Show settings for: Find Results Window" and change the "Current List Location" background color.

libreoffice massive text color change

Is there a way to change all occurrences of a specific color in a text in LibreOffice or Openoffice?
yes: With cursor in the find box:
hit "more options" in the Search & Replace dialogue;
click on "Format...";
select "Font effects";
select the color to search for;
Repeat the same for the replace box, selecting the desired new color (or "Automatic" to reset it to the default).
You can do it via AltSearch extension:

Resources