From the course: Visual Studio Developer Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Move code with keyboard shortcuts

Move code with keyboard shortcuts - Visual Studio Tutorial

From the course: Visual Studio Developer Tips

Move code with keyboard shortcuts

- [Instructor] I'll bet that you have your favorite way of moving text around inside the Code Editor. This tip looks at a relatively unknown technique that allows you to move text using just your keyboard. And no, this tip is not showing you how to cut and paste code in the Code Editor. I assume that you know how to do that. Instead, we'll look in how to use a built-in Visual Studio command. I'll start by selecting this 'foreach' block of code on the bottom of the screen. Now that it's selected, I want to move it around on the screen. To do that, hold down the Alt key and either tap the Up Arrow or the Down Arrow. I'll try that. Hold down the Alt key and I'll tap Up. You see what happened? It moved it up to the new location and it also made sure that the rest of the code moved down below the block of code. Now where is this command coming from? Let's review how you understand the commands that are part of Visual Studio. Open up the Environment section and then go to Keyboard and this…

Contents