Do you know that you can easily shift code lines in #VisualStudio 2013?

As a developer working inside Visual Studio IDE, there comes many scenarios when we need to position our code few lines above or below the other. Sometime such kind of refactoring of code is quite obvious to execute the code properly.


Considering this case, Microsoft came up with a new enhancement in Visual Studio 2013 where you will be able to position your code easily just using shortcuts. Let’s see what it can do.


What’s new in Visual Studio 2013?

If you are new to Visual Studio 2013, you may want to check the below posts first:


Quick Shifting of Lines

Using this enhanced feature, you can shift your codes top or bottom of the current line inside your Visual Studio 2013 IDE. You can move a single line or you can select a no. of lines together as a code block and place it properly. In order to shift a single line, just position your cursor on it and press the keyboard shortcut “ALT + UP Arrow or DOWN Arrow”. Pressing Up Arrow while ALT key is pressed, will move your code one line above the current line. Similarly pressing Down Arrow while ALT key is pressed, will move your code one line below the current line.


Similarly, if you want to move a bunch of lines, select those lines and either press ALT + Up Arrow or ALT + Down Arrow depending on your choice of moving the block up or down by one line.


Here is a video demonstration of this feature which you can see live:




I hope this small tips & tricks will help you while writing or refactoring your code. Isn’t it? No more additional plug-ins for this feature, just use Visual Studio 2013 and rest is yours. Drop a line below with your experience of Visual Studio 2013.


Don’t forget to connect with me on Twitter, Facebook and Google+ to get the technical updates. Also, subscribe to my blog’s RSS feed to get the notification directly in your inbox. Happy coding. Cheers.

If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter , Facebook , Google+ and LinkedIn . I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.


© 2008-2016 - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top