Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I select text inside of braces in Visual Studio Code?

In Atom I can select inside of brackets with CMD+CTRL+M. How can I do this in Visual Studio Code? I've checked the keyboard bindings, but didn't find anything.

like image 932
Stephon Harris Avatar asked Oct 07 '16 02:10

Stephon Harris


2 Answers

There are 2 even better alternative commands in the keybinding file you might want to check out:

editor.action.smartSelect.grow

and

editor.action.smartSelect.shrink

They select everything in between the next boundary (quotes, brackets, curly braces...) and the selection grows to the next boundary when you hit the shortcut again.

Default shortcut is ctrl+shift+cmd+right / ctrl+shift+cmd+left, which is a bit too "finger heavy" for my taste, so you might want to rebind it (I use ctrl+up / ctrl+down).

like image 152
kwood Avatar answered Oct 19 '22 07:10

kwood


Shift+Alt+Right for selecting all text inside the braces.

CTRL+Shift+\ for jumping between opening/closing braces (or) parentheses.

like image 40
SridharKritha Avatar answered Oct 19 '22 09:10

SridharKritha