In Notepad++, when you do Search -> Find, it automatically populates the "Find what:" field according to the behavior below (per the online documentation - emphasis mine)...
In the Find what field, type the text you want to find. This is automatically filled with the current selected text, or the word under the caret, or the last searched pattern, when the Find dialog is opened.
Is there a way to change or disable this behavior? I would prefer that it come up empty. I don't mind the last searched pattern as a reasonable default, but it drives me nuts when it keeps changing the search value by automatically selecting a word next to the cursor.
I've done quite a bit of digging (settings, help, web searches, etc.) and can't find a way to turn this off.
Sometimes referred to as a run around and wrap around, word wrap is a feature in text editors and word processors. It moves the cursor to the next line when reaching the end without requiring you to press Enter .
You can click on Find Next and replace one at a time, or our favorite, Replace All, which will automatically search and replace everything. WordPad works the same as NotePad, except you can find Replace near the top-right.
Using Regex to find and replace text in Notepad++ In all examples, use select Find and Replace (Ctrl + H) to replace all the matches with the desired string or (no string). And also ensure the 'Regular expression' radio button is set.
This problem has been fixed since 2019. I downloaded version 7.8.8 and found an option to turn this feature off in Settings > Preferences > MISC > Don't fill find field in Find dialog with selected word.
There is no standard option to do this but you can achieve it by:
The harder way: download N++ sources and make your own N++ build with desired modification
The easier way: using AutoHotKey tool, capture Ctrl+F shortcut (with condition only if N++ window is active, see #IfWinActive
directive ) so when it is pressed, send keys Ctrl+F, Backspace. Similar for Ctrl+H (Replace)
The AHK macros which work for me are:
SetTitleMatchMode, RegEx
;--------------------------------- Hotkeys for Notepad++ only
#IfWinActive ahk_class Notepad\+\+
; present 'find' dialog with empty field
^f::Send ^f{Backspace}
; present 'replace' dialog with empty field
^h::Send ^h{Backspace}
; another example: close document with either ^F4 or ^W
^F4::Send ^w
#IfWinActive
For details regarding AutoHotkey macro setup, please check steps 1-5 in this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With