.NET Power Tip 18: Visual Studio Block Selection / Block Copy Mode

Usually, when selecting text in a text editor, the text is selected line by line. This means that if I would hold the mouse button in the middle of a line and drag down, the selection would automatically select the current line to the end and continue with the next line.

With block selection it is possible to select a rectangular block of text. Just hold down the ALT key while making a selection:

Abb7_BlockSelection

This can be very convenient, if you need to delete text in multiple lines, for example.

It is even possible to replace the entire block of text with something else. You can select a block using the ALT key, hit CTRL-V, select another block holding the ALT key and use CTRL-V to paste from the clipboard.

It is even possible to select an empty block, that is a code block that has a width of zero characters. Note the thin blue line after “Tasks”:

image

Suppose we would like to change the word “Tasks” to “TasksList”. With the block selected, we can just type the characters and they will be inserted on every line:

image

image

image

image

Category:Business
PREVIOUS POST
.NET Power Tip 17: Visual Studio Scroll Bar Map Mode
NEXT POST
.NET Power Tip 19: Copying, Cutting, Pasting and Moving Lines in Visual Studio

0 Comment

LEAVE A REPLY

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

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