Note that there are some explanatory texts on larger screens.

plurals
  1. POMove line Up/Down shortcut in Visual Studio 2012
    text
    copied!<p>In VS2010 I had a shortcut set up <kbd>Alt</kbd>+<kbd>Up/Down</kbd> to move lines of code up or down, just like I used to have in Eclipse in my Java days.</p> <p>Now since Power Tools and macros (which is how I set up this shortcut in VS2010) are not available in VS2012, how do I get this to work?</p> <p>I've seen somebody mentioned that Resharper can do this, but for the love of fire and water, I can't find the command names in the list of commands that can do that. I have tried ReSharper_MoveUp/MoveDown and that does not move lines up/down:</p> <p><img src="https://i.stack.imgur.com/NHRPQ.png" alt="Move_Up command did not do the trick"></p> <p>This moves blocks of text up and down. I just want line-by-line up or down, no fancy logic there. Before</p> <p><img src="https://i.stack.imgur.com/C8E7c.png" alt="What I have"></p> <p>After <kbd>ALT</kbd>+<kbd>Up</kbd> (when cursor is on WriteLine line) I would like to see this:</p> <p><img src="https://i.stack.imgur.com/CLe3u.png" alt="Line moved one up, inside the bracket, indented"></p> <p>I have seen these threads: <a href="https://stackoverflow.com/questions/4526715/whats-the-equivalent-for-eclipses-altup-down-move-line-in-visual-studio">What&#39;s the equivalent for eclipse&#39;s ALT+UP/DOWN (move line) in Visual Studio?</a>, <a href="https://stackoverflow.com/questions/313462/visual-studio-hotkeys-to-move-line-up-down-and-move-through-recent-changes">Visual Studio: hotkeys to move line up/down and move through recent changes</a>, but none of the suggested solutions work in VS2012. </p> <p>Any other ideas?</p> <p><strong>UPD 7 Nov 2012:</strong> . Extensions are catching up with Visual Studio 2012. Now I know at least 3 extensions that provide this functionality:</p> <ul> <li><a href="http://visualstudiogallery.msdn.microsoft.com/b3ee08dc-a28f-4aec-9efa-69215ab5ee52" rel="noreferrer">MoveLine Extension</a>. Link provided by <a href="https://stackoverflow.com/a/12696202/809357">Carl G</a></li> <li><a href="http://visualstudiogallery.msdn.microsoft.com/814eb3c4-7d5e-4217-9711-e20117b20649" rel="noreferrer">Move Line Extension</a> with modifications to 2010 version. By <a href="https://stackoverflow.com/a/12530141/809357">gius</a></li> <li><a href="http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd" rel="noreferrer">Productivity Power Tools 2012</a>. Have not actually tried this, but <a href="http://blogs.msdn.com/b/visualstudio/archive/2012/11/07/productivity-power-tools-2012.aspx" rel="noreferrer">this blog post</a> states it does the line move up/down</li> </ul> <p><strong>UPD 15 Nov 2012:</strong> Just stumbled across another extension that claims it does what is required here. Have not tried it though: <a href="http://visualstudiogallery.msdn.microsoft.com/92ef7620-d7f6-493f-825a-ba52d07d56c2?SRC=VSIDE" rel="noreferrer">LineMan Extension</a></p> <p><strong>UPD 10 May 2015</strong> Just installed VS2015 RC and this is built-in already: <a href="https://i.stack.imgur.com/VhhJt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VhhJt.png" alt="MoveLineUp/Down"></a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload