Community
    • Login

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

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 775 Views 1 Watching
    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.
    • pbarneyP Offline
      pbarney
      last edited by

      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?

      Terry RT mkupperM 2 Replies Last reply Reply Quote 0
      • Terry RT Offline
        Terry R @pbarney
        last edited by Terry R

        @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
        • mkupperM Offline
          mkupper @pbarney
          last edited by

          @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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors