• Login
Community
  • Login

Bookmark or pass particular "replace" command via cmdline?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
6 Posts 4 Posters 397 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    Frank Tennet
    last edited by Feb 24, 2022, 11:32 AM

    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++?

    E N 2 Replies Last reply Feb 24, 2022, 11:48 AM Reply Quote 0
    • E
      Ekopalypse @Frank Tennet
      last edited by Ekopalypse Feb 24, 2022, 11:49 AM Feb 24, 2022, 11:48 AM

      @frank-tennet

      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 file config.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.

      A 1 Reply Last reply Feb 24, 2022, 12:37 PM Reply Quote 1
      • A
        Alan Kilborn @Ekopalypse
        last edited by Feb 24, 2022, 12:37 PM

        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.

        1 Reply Last reply Reply Quote 0
        • N
          Neil Schipper @Frank Tennet
          last edited by Feb 24, 2022, 1:41 PM

          @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.

          A 1 Reply Last reply Feb 24, 2022, 1:48 PM Reply Quote 1
          • A
            Alan Kilborn @Neil Schipper
            last edited by Alan Kilborn Feb 24, 2022, 1:48 PM Feb 24, 2022, 1:48 PM

            @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.

            1 Reply Last reply Reply Quote 3
            • A
              Alan Kilborn
              last edited by Feb 24, 2022, 1:53 PM

              These currently-open requests for the software might be relevant, if my interpretation of the OP’s desire is correct:

              • https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5823
              • https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4700
              1 Reply Last reply Reply Quote 3
              1 out of 6
              • First post
                1/6
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors