SAVE all favorites?
-
Ideas discussed in the forum are not official feature requests. If no one took the time to follow these instructions (FAQ) for making an official feature request, then the development team was never informed that the feature was desired. Without that, there is very little chance that they will happened to have thought of implementing that feature in the interim.
For the short term, having a file with your common expressions would be best. If you had only a few, I would suggest recording them as macros: see my recent post and the official docs on search-and-replace macro syntax. But with 50, that would make the Macro menu pretty crowded.
For the long term, follow that FAQ to make the feature request, and paste a link to that request in this thread (and probably in the previous thread you linked).
However, there’s a chance that the developers will not agree that the feature needs to be implemented in the main codebase. If that’s the case, a plugin could be written… but unless you have coding skills to be able to write your own, the chances are slim that someone here has the time to write a full-blown plugin for this.
Finally, it could probably be hacked up using a scripting plugin, using an InputBox to input the “name” of the search/replace pair you wanted, with a lookup table mapping the 50 or so names, and then after the pair is chosen, pre-populating the replace dialog with the values from the mapping. It wouldn’t be the prettiest user interface, since InputBoxes aren’t the world’s nicest input interface – but they are one of the few directly available to the scripting plugins without a lot of extra coding. And I’m not quite sure how the pre-populating of the replace dialog would work.
-
Here are a couple of already open Notepad++ issues that may be similar to what the OP is seeking:
-
@Alan-Kilborn Just quick this, thank you Alan. With the second, azijo sort of captured my interest (two suggestions: “save” and “select” button) but with his last sentence he lost me. I really mean sth much simpler to implement, and I am still confident, someone has done that long ago… ;)
-
@PeterJones Thanks Peter for this very detailed set of suggestions!
To me all those sound like “too complex to be useful, from the suggested user interface to the programming itself”. Then IT SEEMS to me, it’s better I continue with my lame workaround:-
I either “redevelop” my needed search/replace each time I need it: some I use daily (those pop up in the “history”, no problem), but most monthly or quarterly or yearly: none of these remain visible/selectable, of course.
-
or else, I save the search string in one “Multiclipboard” field, and the replace string in another. And the same with every additional set. (multiclipboard allows “unlimited”, so no problem, this approach)
The second I still find unneccessarily laborious though: because it is. - Allowing the “history lists” for search and replace INSIDE NOTEPAD++ to be as long as users want is surprisingly easy instead: the current limit to 10 or whatever, that was work, that did require programming.
With my suggestion, the only new thing required would be:
- taking out the limitation
- and ideally, yes, adding a “Save” button, such that after closing notepad++ (computer restart!) not all “history” is lost, like now.
I IMAGINE somewhere in “registry”/ code “settings” / whatever, there is a way to at least UNlimit the “history”, while the “Save” button would require a little programming, yes.
-
-
@David-Bennett said in SAVE all favorites?:
taking out the limitation
You can bump up the default limit of 10 to a top end of, I think, 30, by editing the
config.xml
file (with a different editor than N++) and increase the variousnbMaxFindHistoryXXX
values. -
Alongside what @Alan-Kilborn correctly pointed out while I was starting my reply…
@David-Bennett said in SAVE all favorites?:
to be as long as users want is surprisingly easy instead: the current limit to 10 or whatever, that was work, that did require programming.
I know you were saying things like “it seems” and “I imagine”, but you are not technically correct here. Lists of strings require programming to implement, whether they are fixed lists or dynamic lists: you either have to program the simple “I want a list that can hold N strings”, or you have to use some method that dynamically allocates space for another string in the list every time a new string is requested. The dynamic lists are not something fun to code at the low level, especially if you are trying to avoid bugs. There are libraries available for such things, but in my experience, it usually isn’t as simple as just saying “I’ll just allow a list of N strings” and being done with it. And since that design decision was made many years in the past, it is now how it’s currently implemented.
taking out the limitation…
in …code “settings” / whatever, there is a way to at least UNlimit the “historyTo change it at this point would take more programming, despite your imaginings, because the calls would have to be changed from the fixed-list method to the dynamic list method every place this list is used, which might be throughout the codebase, if you wanted to switch from the current limited version to the arbitrary-length dynamic list.
OTOH, since the
nbMaxFindHistoryXXX
values exist, it should be fairly easy, to update the codebase to change the upper limit for that setting (instead of the probably ~30 that Alan mentioned) – but that would just move the problem until the new hardcoded limit was hit (and with this strategy, there would still have to be a hardcoded limit, because this OTOH is about keeping the existing strategy, with just a tweak in the goalpost), and it gets into the territory “if I make it too big, it’s taking up unnecessary memory footprint, so how big to keep customers happy with the length of the list without upsetting them because of memory/performance issues”.But, your misunderstanding of low-level string manipulation notwithstanding, we are not the developer of the application, so cannot make code changes for you via the forum. Since you don’t like our alternate suggestions, if you have a feature request, this FAQ explains the correct place to make feature requests. But understand that requesting a feature is not a guarantee it will be implemented.
-
@Alan-Kilborn You are an angel, thank you. I gonna go looking for that file once I have replied here :)
-
@PeterJones said in SAVE all favorites?:
Oh lord, no, I would not even imagine you/other users here, would “do the code changes”, no. You misunderstood the intent of my post (meant to be a question) = I asked badly, sorry for that.because the calls would have to be changed from the fixed-list method to the dynamic list method every place this list is used
This and more now made me realize that - programming-wise - we come from different worlds:
Back in A.D. I started with PASCAL, a language that forces “students” (I was 8) to learn to write structured code (a conundrum these days, agreed), and so I would (=did) simply put that in a “REPEAT” loop, no big deal :)And in terms of memory space and performance, as you rightfully point out, it doesn’t need to cause an issue either: We are dealing with simple characters, to be entered in both find and replace, no big deal, the notepad++ plugins alone have 1000sss of times more “code” than what I would program for this.
Only thing is: a) I believe a simple solution exists (is an obvious need), and b) whatever notepad++ was coded in almost certainly is not a “language” I old man would know and now want to learn, lol.Meaning: I go with your and Alan’s lovely workaround of using 30 find/replace at least, better than nothing, you know. Needa sleep now, but will go lookin for that xml file thereafter :)
MUCH THANKS to both of you, you’ve been helpful!
-
@Alan-Kilborn said in SAVE all favorites?:
nbMaxFindHistoryXXX
I looked already, but can’t find it, are you sure it’s called config.xml and is in the notepad++ folders somewhere, Alan?
-
@David-Bennett said in SAVE all favorites?:
@Alan-Kilborn said in SAVE all favorites?:
nbMaxFindHistoryXXX
I looked already, but can’t find it, are you sure it’s called config.xml and is in the notepad++ folders somewhere, Alan?
config.xml
is found in the%AppData%\Notepad++
folder for a normal installation (just do File > Open and type in%AppData%\Notepad++\config.xml
, and the right file will be opened)If you aren’t using
%AppData%
, then either you have a portable/local version (in which caseconfig.xml
is in notepad++.exe’s directory) or you have moved your settings to the cloud, in which case you need to see Settings > Preferences > Cloud to know which folder containsconfig.xml
.As always, if you supply us with ? > Debug Info, which contains much of this information, we can help you better.
-
@PeterJones said in SAVE all favorites?:
just do File > Open and type in %AppData%\Notepad++\config.xml, and the right file will be opened)
Yes, but maybe do that in plain old Notepad.exe and not notepad++.exe.
Why? Because notepad++.exe, when exiting, will blow away any changes made to config.xml as it saves its current config. -
@Alan-Kilborn said in SAVE all favorites?:
Yes, but maybe do that in plain old Notepad.exe and not notepad++.exe.
Amend that to:
Yes, but maybe do that in plain old Notepad.exe and not notepad++.exe, and have notepad++.exe not currently running. -
This is a bit of a hack, but could you use the Explorer plugin which has a Favorites dockable? In the Favorites, you have a “Files” section so you could create a file with each regex, one per line, save it somewhere and then add it’s shortcut to the Explorer Favorites “Files” section. Then when you want a regex, just open that file, highlight the regex you want, press Ctrl-F so it autopopulates the regex in the Find dialogue, select the tab you want to search and GO!
I can’t make a screen animation, but maybe the following screenshots illustrate?
Cheers.
-
Your tips are all great, thanks.
While making the changes to nbMaxFindHistoryXXX values, I realized: “that’s not gonna help: N++ deletes the history upon each close (shutdown computer or shutdown N++), so regardless how many you allow, it’s a waste of time that way”.So then I considered Michael’s suggestion too (thanks again): honestly, then I maintain that using multiclipboard is WAY faster and more user friendly.
I won’t put a screenshot here either, how I use it, simply because my sheets in multiclipboard are full of private stuff. But here’s WHY I find it the better solution if a N++ native solution can’t be found:- I ctrl-c the regex search string I devised
- I ctrl-c the regex replace string I devised
- I move both copies within multiclipboard to a place I find them more easily (orga is critical with such empowering tool), give them a color or name if I bother, and that’s it.
Then when I need one combination devised earlier, I click MCB and then click on the saved string that I need, and it autofills in the application used last (N++ in this case).
If you are thinking “but that’s fast anyway”, yes, still, if a N++ native solution exists it’s much better still: I could select both string right there and then. :)
Anyway, you all seem to agree that N++ does not have a native feature for saved historical search/replace strings. Hence why I will for now continue to save important combinations in MCB.
But THANK YOU all so much!
David -
@David-Bennett said in SAVE all favorites?:
While making the changes to nbMaxFindHistoryXXX values, I realized: “that’s not gonna help: N++ deletes the history upon each close (shutdown computer or shutdown N++), so regardless how many you allow, it’s a waste of time that way”.
Not sure what that means.
If true, it would totally make even having a concept of history pointless, wouldn’t it?
Can you explain in more detail what you think you are seeing?
Find history works just fine for me. -
@David-Bennett said in SAVE all favorites?:
a N++ native solution exists it’s much better still
Yes, I don’t think you’ll get anyone disagreeing with that.