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

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

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")
    send ^{f}
    send {down}
    send {up}   ; avoid going 2 steps back

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.

  • @Danijel see the updated code – Mikhail V Apr 2 '19 at 20:29

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" ?>
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="no" />
<History nbMaxFile="2" inSubMenu="no" customLength="-1">

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.