How do I move a line up or down by keyboard (alt-up and alt-down don't work with R#)

Before i installed R#, I used to use Alt-UpArrow and Alt-DownArrow to move a line of code up or down. Since installing R#, these shortcuts now take you to the previous or next code block. This is a useful shortcut, but I still want to be able to move a line up or down. I can't find a shortcut for this in the docs?

Anyone know how to do it? I'm using the VS scheme if it makes any difference.

Thanks

3 comments

Just noticed ReSharper_MoveUp and ReSharper_MoveDown in the commands, but these move the whole code block up or down. Can't seem to find a command for moving a single line, or the selected block (which is what VS does when you use Alt-UpArrow and Alt-DownArrow).

0

Ctrl+Alt+Shift will temporarily select a code "entity", like a statement, parameter, etc, and then allow you to move it around via the arrow keys.  It is dependent on the context of where the cursor started and tends to just do the right thing.  Like if you're on an argument in an arg list then just the arg is selected, or on a function declaration it'll select and move the function up or down in the file.  It has some advantages like you can left arrow to pop a statement out of an if block, or right arrow to pop it into one.  

But, you asked about single lines.  I suggest mapping the original VS command to some new key combination.

0

Please sign in to leave a comment.