Search code examples
notepad++

Move selected text in Notepad++


I've been looking in the Notepad++ shortcuts and options for something that permits me to move selected text in any direction, but I couldn't find anything.

There are two commands I use very often that offer similar functionality "Move Up Current Line" and "Move Down Current Line" but they apply to an entire line and I need something to work with just a selected text.

That functionality is very useful for rearranging columns or elements inside arrays.

Do you know a way to do this? Or maybe an extension or macro?

Edit:

Here some graphical examples of the functionality I wish:

You have some code: enter image description here

You notice a expression is not in the right place. Why copy-paste? Why not move it? enter image description here

Or even set it in the previous line, just using the arrow keys: enter image description here

The idea is to move the selected text as a unit.


Solution

  • I'm not sure I understand well what is your request, but, is that what you want:

    • select with the mouse the part you want to move (ie. var c = 34;)
    • keep pressed the left bouton
    • drag the selected text to the line above
    • drop it at the right place