1

How can I configure Visual Studio Code to enable column selection (multi-line selection) like this:

  • Drag a line with Alt+Mouse 1
  • When crossing a line with lower indentation level, create indentation implicitly to match the indentation level indicated by the drawn line

On the left-hand side you can see the desired behaviour (in TextMate), on the right-hand side my current attempt in VS Code:

textmate vs vscode

1
  • 1
    No built-in way to do that. Search for "virtual space" here on SO for other questions about this. Commented Feb 2 at 18:06

1 Answer 1

2

Virtual-Space Pull Request

Apparently, an underlying feature, which is called virtual space, has been requested in 2016. A pull request from September 2024 is yet to be merged. The scope of the pull request is wider than the column-selection feature, but does include it.

Demo

I've just tried out the pull request and it resolves the issue.

virtual-space demo

How to Install the Pull-Request Version

[2025-02-03 12:59:05] fiedl@fiedl-mbp ~/code
▶ git clone [email protected]:microsoft/vscode.git

[2025-02-03 12:59:05] fiedl@fiedl-mbp ~/code/vscode
▶ git remote add x17jiri [email protected]:x17jiri/vscode.git
▶ git checkout x17jiri/virtual-space-4
▶ brew install node@20
▶ npm install
▶ npm run watch
▶ ./scripts/code.sh
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.