• Login
Community
  • Login

Any plugins to extract selected text into a new file (for refactoring)?

Scheduled Pinned Locked Moved General Discussion
3 Posts 3 Posters 429 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.
  • P
    pbarney
    last edited by Dec 18, 2023, 11:22 PM

    I’m refactoring a large codebase and it would be helpful to be able to select a section of text, and then with a keypress, cut the text out, open a new file and paste the text into it.

    Does such a thing exist?

    T M 2 Replies Last reply Dec 18, 2023, 11:35 PM Reply Quote 0
    • T
      Terry R @pbarney
      last edited by Terry R Dec 18, 2023, 11:37 PM Dec 18, 2023, 11:35 PM

      @pbarney

      Well the obvious comes to mind first. Just create a macro of the key presses to cut, open a new file and paste.

      It does sound like you might have more to the story though so you would need to elaborate if this doesn’t solve your need.

      Terry

      PS I should add, that once the macro is created you can assign a shortcut key to activate it.

      1 Reply Last reply Reply Quote 3
      • M
        mkupper @pbarney
        last edited by Dec 19, 2023, 6:04 PM

        @pbarney, if the intent is refactoring then I don’t think you want to cut snippets out to put them in separate files as you are then creating a large problem of how to safely merge the refactored code back into the original source files.

        Thus, it’s usually better to to refactor in place.

        For large refactor projects I tend to use scripting languages to process the files rather than Notepad++. The choice of scripting languages does not matter as long as they are ones you are comfortable with.

        1 Reply Last reply Reply Quote 2
        1 out of 3
        • First post
          1/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors