Eclipse Tip: Best Keyboard Shortcut Ever

Mar 13 2009
Posted by Mark

In any Eclipse text editor (which includes all of Aptana’s as well), you can swap 2 lines of code (the current line and either the one above or below it).  This trick accomplishes the same goal as highlighting and cutting and pasting, or highlighting and code dragging. But line swap is much quicker than either.

On Linux and Windows, it’s ALT+Up or Down Arrow. On Mac, it’s OPT+Up or Down Arrow.

code-tip-line-swap

The official names in the Preferences section (Preferences->General->Keys) of either Aptana or Eclipse are “Move Lines Up” and  “Move Lines Down”. And as the names imply, the trick works with multiple selected lines, or blocks, of code.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply