Vscode: Allow to select text while jumping between brackets

Created on 26 Jul 2016  路  9Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.3.1
  • OS Version: Win 7 x64

For me, the default shortcut for jumping to matching bracket was ctrl+shift+\
I changed it to ctrl+] and while holding down shift, I expect it to select the text from bracket to bracket. I believe that this is a reasonable request as this behaviour can be seen in many other text editors.

Thanks!
Also just want to thank you for doing this, I love this editor!

editor-bracket-matching feature-request good first issue

Most helpful comment

Hey guys. Me and some friends would like to solve this one for a school project. Is that ok?

All 9 comments

This could be implemented in the BracketMatchingController by:

  • adding a new action
  • mostly invoking the same methods, but instead extending the selection
  • writing tests :)

I can have a look at this!

Any updates @chewong

Hey guys. Me and some friends would like to solve this one for a school project. Is that ok?

@afonsobspinto thanks! I'll take a look at the PR ;)

I think it would also make sense to add a variant that only selects the corresponding bracket, and not the text between. Similar to CTRL+D but would skip intermediate matches and only select the matching bracket/brace/paren. Thoughts on that?

what's the status on this?

It's merged! 馃帀
I'm hoping January release? Not sure how these releases work. The last update I have is November 2017.

Thanks @afonsobspinto & friends! Praise! 馃檶

This will ship in the upcoming January release, thanks to PR #39066 from @afonsobspinto

To do what the OP requests, edit keybindings.json:

    {
        "key": "ctrl+\\",
        "command": "editor.action.jumpToBracket",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+\\",
        "command": "editor.action.selectToBracket",
        "when": "editorTextFocus"
    }
Was this page helpful?
0 / 5 - 0 ratings