How to do Visual Studio-style rectangular selection in Visual Studio Code?

Viewed 1101

Some people who move from Visual Studio Code (VSC) to Visual Studio (VS) want to get VS to use the same key bindings as VSC, and there seems to be a way to do so.

I want to do the reverse. My main editor is VS, and there are some files that I want to edit on VSC, so I want the key bindings on VSC to behave like VS.

In particular, I'm interested in the rectangular, or multiline editing capabilities. In VS, I can Alt-Shift-Arrow to create a rectangular selection, which I find very useful:

I want to do the same in VSC. The closest I've found is the "multi-cursor" functionality, which kinda-ish sorta-ish works in a similar way:

However, there are two key differences with how VS works, which make it a bit frustrating to use:

  • The key bindings I've found are only for adding cursors. If I select too much, I can't refine my selection -- I have to start from scratch.
  • The cursors have to be in valid cursor locations. I can't add arbitrary locations to my selection like in VS. This is particularly useful when adding and removing single-line comments to a large area of code, which may include empty lines.

Is there a way to get VSC to do rectangular selection, just like VS?

0 Answers
Related