Is there a keyboard shortcut or an extension that would allow me to select a block of code?
I'd like to select everything between curly braces, between HTML tags, etc.
Double-click on Select to Bracket and press a Keyboard shortcut you like, for example Command + Shift + H . Now, whenever you want to select code in a block, put your cursor inside the block and press your shortcut.
Use Alt + Shift + → to expand the selection between braces or tags.
Use Alt + Shift + ← to shrink the selection between braces or tags.
Here is the Microsoft Visual C++ shortcuts cheatsheet that might help you.
Update 2019/3: this inner functionality of Visual Studio is not working very well after some updates. Alt + Shift + → now selects things including braces (which annoys me).
It is not like its behavior before. It selected things between curly braces, when I first posted this answer. I'm using Mark's answer now.
If anyone has a better solution (without an extension) now, please leave a comment.
On Mac Ctrl + Shift + → to expand the selection. Press multiple times to expand to the block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With