[feature requet] New Selected Multiple Documents
-
I have a need to apply a find or find/Replace to Multiple Open Documents (MOD Scope). A simple new scope would do it.
Mark/Unmark the tab with Ctrl-Click and the MOD scope gets activated
That feature would be a fantastic time saver
-
-
@Mit-Jean
If all your open documents are in a reasonably small directory tree (e.g., you don’t have one inC:\Users\yourname\Documents
and one inC:\Program Files\Notepad++
), you can use MS-DOS wildcard syntax to select patterns in filenames.For example, if I have the following files open in Notepad++
README.md foo1.md subdir1\bfoo.axt subdir2\bar.bxt subdir2\foo2.cxt subdir3\foo2.md subdir4\foo300.dxt subdir4\subsubdir\foo99.fxt
you could use
foo*.?xt
to select only the files where the filename starts withfoo
and the extension is one character followed byxt
, which would include onlysubdir2\foo2.cxt subdir4\foo300.dxt subdir4\subsubdir\foo99.fxt
This syntax is kind of frustrating and confusing in its limitations (read the documentation linked above very carefully to understand them), and while I like Notepad++ for find/replace operations in a single file, I will almost always use VSCode for find/replace operations in numerous files because it is much more performant and makes it a lot easier to include/exclude certain types of files.
-
My need is to apply s/rep is on currently open, possibly including not having been saved yet.
-
Notepad++ has a plethora of ways to decide which file(s) should undergo search/replace. I am not convinced it needs another.
- One document: Search > Replace > Replace All = does replacement whether there’s a saved file or not
- All open documents: Search > Replace > Replace All in All Opened Documents = does replacement whether there’s a saved file or not
- Across multiple files: Search > Find in Files > Replace in Files = does replacements only in files saved to the filesystem
- Across a specific set of files in a “Project”: View > Project Panels > Project Panel N, then in the Project Panel, Right Click on the workspace > Find in Projects (or Search > Replace, pick the Find in Projects tab) and then run Replace in Projects
My original thought was that, instead of somehow “marking” a file for “MOD scope”, you would just add your file to the project, and use Find in Projects. But since you want to include documents that haven’t been saved to a file yet, that won’t work (because Projects require that there’s an underlying file for everything added to the Project). However, I might give the advice that it would improve your workflow (and reduce the chances of losing data) if you were able to update your workflow to always save a file to the filesystem before doing any search/replace in it (especially as a multi-file S/R, as that’s a situation where you might not notice right away that your S/R didn’t work quite as expected, and you might move beyond the undo-history before you discover your mistake). (My personal opinion is that anyone who tries to do any more editing than Create File then Save, or maybe Create File then paste boilerplate then save, is just begging their computer to lose data for them: computers crash, and applications cannot perfectly/flawlessly prevent loss of data when they do; having unsaved data is foolish, IMO. For the ephemeral stuff, I have a “scratchpad” document always open, and I make liberal use of the AutoSave plugin, as described in this FAQ. My only exception to this rule is that I often create an empty unsaved tab to paste in data from a post in this Community, verify my suggestion works, and then delete it, all with it never being saved to disk; but that’s because I know that there is a 0% chance that I would care that the data were lost if my computer crashed while I was in the middle of it, because it’s data copy/pasted from the forum.) But enough of my preaching.
If you were to make an official feature request – like @Alan-Kilborn hinted with his link – then I would say don’t word it as you currently do: Notepad++ already has a way to apply a specific color to a document’s tab (right click on the tab, Apply Color to Tab > Apply Color N), so instead of creating yet another way of marking the file for your “MOD scope”, what I would suggest is asking for “Replace in All Tabs of Color N” where “N” is 1…5 for the five possible colors; this would make the interface very similar to the Find in Projects dialog, where you can select one of the three project panels. That way, instead of having some new concept of “MOD scope”, it would be making use of a way that Notepad++ already provides to indicate similar tabs – it would actually give you five independent “MOD scopes” simultaneously, without introducting another new concept to the N++ interface.