ReSharper Tip: Manual Code Reordering

Most of you already know what ReSharper is and its power; its shortcuts can improve productivity drastically. That is why I really recommend learning its basic keyboard shortcuts for persons that have already ReSharper license. Here is full ReSharper keyboard shortcuts map: http://www.jetbrains.com/resharper/documentation/feature_map.html.

I don’t want to go through all ReSharper keyboard shortcuts now but I want to show a Tip that I discovered for me few days ago named “Manual Code Reordering”. For some of you it could not be new but for other it could be that is why I want to demonstrate them in the post.

Let say you have a method or code block which you want to move UP or Down, usually you will cut it and will paste in right place, for that purpose ReSharper has its keyboard shortcut, so place your cursor on Method Name or other code block and press Ctrl+Alt+Shift and holding the keys for a while your code block will become selected:

Method Move

Now while holding the keys you can move Up/Down the method within the class, you can do it with any other code blocks or (simple statements, code structure such as if/for/foreach etc..).

Ok, but it is not all, if you place your cursor on operand then ReSharper will allow you to change operand order using Left/Right keyboard arrows, something like here:

Operator Move

Maybe some will find this feature as not so useful (as other), but the shortcut save me some coding time. I hope you like it :).

Ahh.. I use ReSharper 4.1. And my ReSharper Keyboard Schema is Intellij IDEA. (ReSharper->Options->General->Intellij IDEA)

PS: If you don’t find something to be useful then maybe you just wasn’t in situation when it would be useful? :)

Thank you,

Artur Trosin

3 Comments

Comments have been disabled for this content.