shortcut for moving marked block

hi,

in Eclipse there is a shortcut where you can move around a marked block up and down (shortcut: Alt+down/up). This is quite handy instead of doing normal copy/paste, if you just want to move code snippets a few lines up and down.

Does IntelliJ provide this?

0
4 comments

The current selection can be shuffled up and down using CTRL+SHIFT-UpArrow and CTRL+SHIFT-DownArrow, resp.


Randall Schulz

0

Okay, I had another try. Weird enough it only works on method boundaries, moving marked blocks out of the method it does not work.

0

Hello manuel,

Okay, I had another try. Weird enough it only works on method
boundaries, moving marked blocks out of the method it does not work.


It's not supposed to. This is a semantic move operation, which tries to keep
the code meaningful after a move. It's hard to guess what would be the meaningful
way of moving code out of a method.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

i see...

but in coding day-life i am moving blocks around without needing this semantic-help. for instance:

having a unit test method and quickly moving an init-block to setUp method, which sits just above.

0

Please sign in to leave a comment.