I like the TextMate that can select a line to move it with a simple keystroke.
Command-shift L (select a line) Control-Command Arrow(up and down) (move the selected line)
How can I do the same thing with emacs?
Commands to move about the screen (can also use the arrow keys.) To go to a specific line: Type M-x goto-line <Enter>, then type the line number followed by <Enter>. There are also shortcuts. Type the command "help -q emacs goto" in a local window to find out about it.
The default bindings are M-up-arrow and M-down-arrow. It works like Eclipse's (same binding) and NetBeans M-S-up/down.
Standard EmacsTriple-click 'mouse-1' somewhere on the line. Click 'mouse-1' at the the start of the line, then click 'mouse-3' at the start of the next or previous line.
Moving lines means to remove them from their original place and put them in another. For instance, if you have a table that appears in one part of a file, and you want to remove the table from that part of the file and put it in another part, you would move (not copy) it.
SO user, Sanityinc developed move-text.el
(an extract of from basic-edit-toolkit.el - by emakswiki regular, Andy Stewart (lazycat))
See: Move line/region up and down in emacs
It does this task very nicely...
M-Up or M-Down to move the current line (or marked region's whole lines.)
I've added it to http://www.emacswiki.org/emacs/MoveText
Edit the bindings at the bottom to suit your preference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With