In RubyMine, shift a line or a whole block of code

RubyMine has a key-mapping for grabbing lines of text in the editor, from cursor focus. If you have your cursor focused anywhere in a line of code you can shift it up or down with the following [default] key bindings:

CMD + SHIFT + Up Arrow || Down Arrow

Supercharge your grabbing
If you want to move an entire block of code without having to highlight the entire block, put your cursor on the definition of the statement and RubyMine will shift the entire block for you.

This can work on blocks defined by module; class; def; if; find more use cases and share because I definitely haven’t uncovered them all yet!

Happy Shifting!

Written on May 12, 2016 by ryanmagowan