Is there in vscode an option to: Select everything between matching brackets

前端 未结 7 1242
孤街浪徒
孤街浪徒 2020-12-08 13:48

Is there in vscode a shortcut available which selects all code between matching brackets e.g. in atom this shotcut is ctrl+alt+m

7条回答
  •  Happy的楠姐
    2020-12-08 14:20

    I still think the expand region extension is the way to go on this. But vscode 1.20 did add the "Select to Bracket" command (see command palette). It has no default keybinding but the command is

    editor.action.selectToBracket
    

    so you can assign your own binding. But it is not as handy as the extension. The smartSelect options mentioned above give me unexpected/unwanted results.

    ---------- Update ---------------

    editor.action.smartSelect.expand command was added at some point after the answers here.

    Bound to Shift+Alt+RightArrow. Will progressively expand the selection including to within and not including the brackets, parentheses if you wish. You will need to keep triggering the RightArrow to get to where you want. Will not select only within the brackets if you start right next to a bracket - start anywhere else and it will.

提交回复
热议问题