You should try drag-stuff !
It works exactly like eclipse Alt + Up / Down for individual lines, as well as for selected lines of a region!
In addition to this, it allows you to move words using Alt + Left / Right
This is exactly what you are looking for! And it is even available from ELPA repositories !
Other solutions have never worked for me. Some of them were erroneous (transposing lines when changing their order, wtf?), And some of them moved a precisely selected area, leaving the unselected parts of the lines in their positions. But drag-stuff works exactly the same as in eclipse!
And even more! You can try to select a region and use Alt + Left / Right ! This transposes the selected area one character left or right. Awesome!
To enable globally just run this:
(drag-stuff-global-mode)
Aleks-Daniel Jakimenko-A. Oct 15 '13 at 10:02 2013-10-15 10:02
source share