I'm looking for a keyboard shortcut which selects the block of code between two parentheses or brackets or squarebrackets compared to the cursor position.
Example:
const object = {
ifTheCursorIs: 'anywhere between the bracket above',
andTheBracketBelow: 'it should select all everything between them',
}
//so if I press the shortcut, then press backspace,
const object = {}
//should remain
I think this post is what you're looking for: https://stackoverflow.com/a/50036560/7351272
For mac users, the short answer is:
Use ctrl
+ shift
+ →
to expand selection between braces or tags,
Use ctrl
+ shift
+ ←
to shrink selection between braces or tags.