3

How do I prevent Notepad++ "Find what" edit box located in the Search window (Ctrl+F) from populating this field with a context value?

2
  • Just for my idea, but what did you expect to have in that box then? Nothing? The previous searched text? Something else? Commented Mar 28, 2019 at 13:10
  • The previous text.
    – Danijel
    Commented Mar 28, 2019 at 13:11

2 Answers 2

2

I'd use an AutoHotkey script which sends 2 commands: Ctrl-F then down, so it will show last search string in the edit box. For example using Alt-F as hotkey:

#If winActive("ahk_exe notepad++.exe")
!f::
    send ^{f}
    send {down}
    send {up}   ; avoid going 2 steps back
return

The extra up command here is needed to avoid going 2 steps back in the list if the cursor is on a blank line and does not paste the string. So it will always show the last searched string in the box.

1
  • @Danijel see the updated code
    – Mikhail V
    Commented Apr 2, 2019 at 20:29
0

Open the Notepad++ installation folder. Open config.xml file with any other text editor except Notepad++ itself. Backup that file before any type of editing otherwise all settings will be gone. Find this type of section:

<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="no" />
<History nbMaxFile="2" inSubMenu="no" customLength="-1">
</History>

Specifically, here we need to focus on <FindHistory/> tag in that file. According to Notepad++ docs:

  • nbMaxFindHistoryPath: Maximal number of search folders being remembered
  • nbMaxFindHistoryFilter: Maximum number of filter strings remembered
  • nbMaxFindHistoryFind: Maximum number of search patterns being remembered
  • nbMaxFindHistoryReplace: Maximum number of replace patterns being remembered

If you do not want to save any search history edit those values to Zero. You can set all four of those to zero or as per your need. Optionally you may remove old/previous find history by deleting <Filter/> and <Replace/> tags. Close any Notepad++ window before modifying those values.

Further Readings

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .