Bookmark or pass particular "replace" command via cmdline?
-
I use occasionally certain advanced “Replace” (RegExp) commands.
In order not to have to remember these difficult command I would appreciate if I could “bookmark” these commands.
Is this somehow possible?
If not: can I pass a corresponding replace command (or script) via cmdline to notepad++?
-
I’m not sure what you meant by bookmark? Save?
No, there is no command line argument to pass search arguments, but
the last used operations are stored in the fileconfig.xml
.
And theoretically you could have a batch file that calls Notepad++ and loads the predefined list, or there is the AnalysePlugin, which I think does what you want. I don’t use it, so I don’t know its current status. -
I think OP is wanting a way to save and later recall regular expression operations (or really any type of search operations), probably by using a tag name.
Currently no such capability exists.
-
@frank-tennet said in Bookmark or pass particular "replace" command via cmdline?:
In order not to have to remember these difficult command
I’ll assume you’ve considered FranksFaveRegexps.txt and determined that it wouldn’t be satisfactory.
It is possible to record a macro that sets up and executes a regex operation, and then save the macro with a descriptive name so it will be available in subsequent sessions; it can also have a shortcut assigned.
The first time I did something like that I was surprised how well it was handled.
I just now did a test where I started a recording, invoked Ctl-h, entered a find and a replace text, executed Replace All, and then, invoked Ctl-h again, entered a different find & replace pair of texts, executed this new Replace All, and then stopped the macro recording. I then verified that invoking the new macro executed the two F&R operations as expected.
-
@neil-schipper said in Bookmark or pass particular "replace" command via cmdline?:
I’ll assume you’ve considered FranksFaveRegexps.txt and determined that it wouldn’t be satisfactory.
LOL.
…macros…
Macros are fine but:
- If you have many it gets unwieldy
- Often you need a variation on a regex you’ve done before, and a macro can’t help with this as it hides everything about the operation from you (unless you want to poke around in shortcuts.xml)
I do think the OP is looking for more “sophistication” in such functionality.
I’m surprised a plugin hasn’t offered this kind of search save-n-restore functionality to this point – or maybe there is one that does it and I just don’t recall.
-
These currently-open requests for the software might be relevant, if my interpretation of the OP’s desire is correct: