Community
    • Login

    Bookmark or pass particular "replace" command via cmdline?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 387 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.
    • Frank TennetF
      Frank Tennet
      last edited by

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

      EkopalypseE Neil SchipperN 2 Replies Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Frank Tennet
        last edited by Ekopalypse

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

        Alan KilbornA 1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @Ekopalypse
          last edited by

          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
          • Neil SchipperN
            Neil Schipper @Frank Tennet
            last edited by

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

            Alan KilbornA 1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn @Neil Schipper
              last edited by Alan Kilborn

              @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
              • Alan KilbornA
                Alan Kilborn
                last edited by

                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
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors