.NET Power Tip 19: Copying, Cutting, Pasting and Moving Lines in Visual Studio

I watch many developers deleting and copying code lines in Visual Studio in an unnecessary complicated procedure. They place the cursor inside the line that they need to delete, cut or copy. Then they use either the mouse or the keyboard to expand the selection to the entire line. With the keyboard, that would be: Hold SHIFT, hit HOME, hit END and the entire line is selected. Then they continue with CTRL-X, CTRL-C, etc.

This fiddling with the keys is totally unnecessary.

Whenever the cursor is at any position in the correct line, you can just use CTRL-X or CTRL-C and Visual Studio will AUTOMATICALLY cut or copy the entire line. Expanding the selection to the beginning and the end of the line is unnecessary.  Smile


Moving lines is even simpler!

Just place the cursor anywhere in the line to be moved, hold the ALT key and use the cursors UP and DOWN to move the line…tadaaa…


.NET Power Tip 18: Visual Studio Block Selection / Block Copy Mode
.NET Power Tip 20: The Cycle Clipboard Ring in Visual Studio

0 Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.

15 49.0138 8.38624 1 0 4000 1 https://www.manuelmeyer.net 300 0