Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste a rectangular block in Visual Studio

Tags:

Is there a way to paste a rectangular block in Visual Studio (2017, for example)?

Enter image description here

The only way I can do it now is paste first the values, and then "surround" the values column with from left and right, like this:

Enter image description here

like image 729
serge Avatar asked Jul 13 '17 10:07

serge


People also ask

How do you copy a block code in VS code?

hold alt and drag my mouse to select a block. Ctrl + C to copy it.


1 Answers

If I understand your question correctly, you can hold Shift + Alt to select a block with the keyboard.

Copy the block from within Visual Studio and then use Shift + Alt again to select the column you want to paste it to. You can then paste it. The same as you would in Notepad++.

If you want to use the mouse you only need to hold the Alt key.

Copy multiline block in Visual Studio

Update for VS Code:

In VS Code it seems to require the mouse. Click to the beginning of what you want to copy, press and hold Shift+Alt then click to the end of what you want to copy. Then release the keys and copy. When pasting, do the same for the column you want to insert.

Copy multiline block VS Code

like image 77
Philipp Grathwohl Avatar answered Oct 05 '22 12:10

Philipp Grathwohl