From the course: Visual Studio Code Productivity Tips
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
A simple technique to copy code blocks - Visual Studio Code Tutorial
From the course: Visual Studio Code Productivity Tips
A simple technique to copy code blocks
- [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 you know how to do that. Instead, we'll look at a built-in VS command. It's almost embarrassing to show this tip, because it's so easy, but I have found that many people don't know about this technique. The idea is I want to move this variable declaration on line six up couple of lines. I put my cursor somewhere in that line of code, like that. Then I hold down the Alt key, and I press the up arrow to move that line of code. Notice that the cursor didn't need to be at the beginning of the line. I can put anywhere in the line and move it. To work with multiple lines, select the lines that you want, like this, and then use the same keystrokes, Alt down or Alt up. That's it. It doesn't get much…
Contents
-
-
-
(Locked)
Use Go to and Peek Definition to find code references4m 29s
-
(Locked)
Refactor the code4m 12s
-
Favorite extensions: Bracket Pair Colorizer2m 53s
-
(Locked)
Tidy code layout with Format Document6m 54s
-
(Locked)
Favorite extensions: XML Tools2m 36s
-
(Locked)
Create custom keybindings for common commands2m 40s
-
(Locked)
Favorite extensions: Spell Checker2m 40s
-
(Locked)
A simple technique to copy code blocks1m 1s
-
(Locked)
Favorite extensions: Sort lines2m 2s
-
(Locked)
Use Emmet notation to add boilerplate text6m 14s
-
(Locked)
Favorite extensions: GitLens4m 24s
-
(Locked)
Use font ligatures to add symbols to your code2m 46s
-
(Locked)
-