DevelopmentHow do I duplicate a line within Visual Studio Code?

How do I duplicate a line within Visual Studio Code?

If you want to easily duplicate a line of code in Visual Studio Code, you can do it with a simple keyboard shortcut. Just use the Copy Line Down (Ctrl+Alt+UpArrow) or Copy Line Up commands (Ctrl+Alt+DownArrow) — depending on where you want the new line inserted with respect to your cursor.

You can view all the shortcuts like this in Visual Studio Code by going to the preference settings found at

File > Preferences > Keyboard Shortcuts

 

Bonus Tip: You can move an individual line of code up or down in the document by using Alt+UpArrow or Alt+DownArrow respectively.

Categories: Development Tags: ,

Comments

No Comments Yet. Be the first?

Post a comment

Your email address will not be published. Required fields are marked *