How to disable FindHistory and FileEditViewHistory? auto-clear at exit?
-
As far as I know out NP++ does NOT provide an option to disable FindHistroy and FileEditViewHistory.
The only way is to manually (!) edit config.xml and delete corresponding lines.
This is surprising and disappointing.
I would call it a privacy issue.Are there any reasons to not let users disable recent file/search pattern lists?
Or at least to let them reduce it to only 1 item via GUI Settings?Or clear this items automatically at exit?
-
The real answer is to lock your PC when you leave it?
-
@Claudia-Svenson in Settings > Preferences, there is a Recent Files History section that allows you to customize the number of files in your history, and it looks like 0 is a valid option:
-
@Claudia-Svenson as for the Find history: I don’t see any settings in the Preferences window for this, but if you look in your
config.xml
file, you will see aFindHistory
tag with severalnbMaxFindHistory...
entries. On my setup, they are all set to10
, and I have 10Find
/Replace
entries in that section. So, in addition to deleting theFind
/Replace
entries, changing thenbMaxFindHistory..
values to0
might prevent NP++ from keeping a history going forward. -
(edit as there was a cross post)
@Claudia-Svenson, @mathlete2 has answered you for both the file history part and then the search history part. I had posted what’s below not realizing that mathlete2 was also answering the second part. Hopefully between what the two of us wrote you will know your to fix your Notepad++.
While Notepad++ is running the history for search/replace seems to be unlimited. However, Notepad++ saves the last 10 things searched for when it exits along with what was searched for.
You can configure how many search terms get saved by editing your
config.xml
file.- Exit from Notepad++
- Using Microsoft Notepad or an editor other than Notepad++ edit Notepad++'s
config.xml
file. - Near the very top of the config.xml file you will see a line with:
<FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" ...>
Change the number 10 to 0 (zero). You will need to change this in four spots on that line.
<FindHistory nbMaxFindHistoryPath="0" nbMaxFindHistoryFilter="0" nbMaxFindHistoryFind="0" nbMaxFindHistoryReplace="0" ...>
- Save the config.xml file and restart Notepad++.
Notepad++ will now be in a mode where the search history still has an unlimited length while Notepad++ is running but when you exit Notepad++ then the search history is not saved.
Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.
Your config.xml file is normally at
%AppData%\Notepad++\config.xml
. If it is not their then post your Notepad++? / debug info
menu results here and someone will help you find the config.xml file. -
@mkupper said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:
Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.
The Configuration Files documentation also suggests using a portable copy of NP++ to do the editing, but another way to work around the overwrites is to:
- Copy
config.xml
to another directory. - Edit the copy with your usual NP++ installation.
- Close the session.
- Rename the original file to back it up.
- Copy over the edited file.
- Copy
-
While the proposed solutions by @mathlete2 and @mkupper probably work, they seem like they would be rather limiting to the user. I mean, well, what happens when the user wants to use the history to e.g. reopen a closed file…or when the user wants to recall some complicated regex search that they conducted yesterday – this data obviously won’t be there.
It’s one thing to answer a question, but it might be a more helpful thing to direct a user to a better place overall. But I suppose we can’t do this because @Claudia-Svenson didn’t elaborate on the situation in place where others could possibly somehow see this data.
There are more privacy concerns with Notepad++ when used in situations such as @Claudia-Svenson 's. An example is “unsaved” text data being saved in the “Backup” folder – gasp, anyone with access to the PC could see this.
It’s all a bit irrelevant, though, as on an “unsecured” PC, a rogue user sitting down at someone’s unlocked PC could see all. I’m not saying this is the @Claudia-Svenson situation, but just what is that situation?
-
There is no reason to question the enquiry/use case from @Claudia-Svenson . Privacy is important and a good reason for the question. Even more, it is good and valid that people are thinking about privacy and asking such questions.
In general it is a similar reason why browsers have a private mode.
I think it is clear, that both, privacy and working without limitation, is not possible at the same time, but removing all kind of history is exactly what is asked for in this topic.
As an example, consider the following use case. Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer. Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards. Open it with Notepad++, does some adaption/formatting/searching to the confidential data. Configure machine. Clear history after finishing work.
I didn’t know that it is even possible to disable find history, thank you @mathlete2 and @mkupper for pointing this out.
Thank you @Alan-Kilborn for addressing the backup topic here, too, and the possibility to disable this feature. This is definitly something @Claudia-Svenson should also have a look at.
-
@MarkusBodensee said:
There is no reason to question the enquiry/use case
I mildly disagree, for reasons already stated… but mainly the reason is “to give better help to a questioning user”. But, in the spirit of “just answer the question posed”, then OK, the earlier answers (besides mine!) were very reasonable.
use case: Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer
Hopefully this is something I.T. has considered. (Of course, @Claudia-Svenson could be I.T., who knows…)
Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards.
In this scenario, I’d remove Notepad++ from the machine, and put portable Notepad++ on the “external storage” along with the data.
But, I normally resist speculation, i.e., using a crystal ball on a question in order to respond, so I’ve violated my own internal guideline on this one.
-
Ok thank you.
Your suggestions seem partially to work.
The “Recent File History” in configuration refers to only the <FileEditViewHistory>. I miss a corresponding option for <FindHistory>.
Its strange that users have to fiddle around in config.xml for an advanced editor like NP++
Furthermore it the checkbox “Don’t check at launch time” is surprising . I cannot imagine a scenario where NP++ should NOT check this option at launch time. So its always checked.
Or does it mean “only check at startup”?
very confusing -
@Claudia-Svenson said:
Furthermore it the checkbox “Don’t check at launch time” is surprising . I cannot imagine a scenario where NP++ should NOT check this option at launch time. So its always checked.
Or does it mean “only check at startup”?
very confusinghttps://npp-user-manual.org/docs/preferences/#recent-files-history
-
@Claudia-Svenson said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:
I miss a corresponding option for <FindHistory>.
Its strange that users have to fiddle around in config.xml for an advanced editor like NP++
TBH, I was a bit surprised that there wasn’t a GUI-based method of customizing/managing the Find/Replace history, but I think it’s great that things like this can be managed via the configuration files; not all software gives users this level of control/flexibility.
-
@Claudia-Svenson said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:
The “Recent File History” in configuration refers to only the <FileEditViewHistory>. I miss a corresponding option for <FindHistory>.
That reminds me that there is a version of “find” that leaves a minimal history and another that leaves no history.
If you are interested in a search that leaves “no history” then see
Find (Volatile) Next (Ctrl+Alt+F3) / Find (Volatile) Previous (Ctrl+Alt+Shift+F3)
in the manual and the manual section on Comparison between “Select and Find Next” and “Find (Volatile) Next”It turns out the non-volatile
Ctrl+F3
orCtrl+Shift+F3
searches leave a minimal history. The manual says they are added to the history but that’s not quite true meaning this may be a Notepad++ bug.If you have some text selected then using the keyboard you can do
Ctrl+F3
orCtrl+Shift+F3
.Ctrl+F3
finds in the forward direction andCtrl+Shift+F3
finds in the backwards or reverse direction.If you use either of those then you will discover it’s in the topmost part of the find history but it gets overwritten should you do another
Ctrl+F3
style search or a normal search. It also does not get saved toConfig.xml
when Notepad++ exits, even if you have the<FindHistory>
values set to something other than zero.Ctrl+F3
areCtrl+Shift+F3
also available via the menus underSearch / Select and Find Next
andSearch / Select and Find Previous
. They are always a “normal mode” search meaning you would not be able to use the\
style escape codes available in extended searches nor the various features of regular expression searches.I have always relied on them as a “quick search” and depend on their
normal mode
operation as they are a quick way for me to search for regular expressions or things with\
as as Windows file paths. I knew they did not get added to the find history and had assumed that was a feature but now see that [the manual](https://npp-user-manual.org/docs/searching/#searching] says “The searched word or selection is stored in the find history.” That’s not quite true. They show up in the history but are not “added” to the history.