Jump to closing bracket in Visual Studio Code

2019-01-30 09:23发布

In VSCode when I type a bracket, e.g '(', it automatically creates the ending bracket: ')'. Are there any shortcuts to jump to the closing bracket or parenthesis, without pressing the 'End' key?

I found a way to do in Sublime Text 2 that did exactly that, using a Regex in the User's Key Bindings, but couldn't find a way to do it in VSCode.

Thank you.

12条回答
啃猪蹄的小仙女
2楼-- · 2019-01-30 09:46

Mac Cmd+Shift+\

Windows Ctrl+Shift+\

As well you can do:

Ctrl+Shift+p

And select

Preferences: Open Keyboard Shortcuts

There you will be able to see all the shortcuts, and create your own.

查看更多
SAY GOODBYE
3楼-- · 2019-01-30 09:47

The out-of-the-box way to do it is

Ctrl + Shift + |
查看更多
贼婆χ
4楼-- · 2019-01-30 09:51

In Spanish keyboard it's Ctrl+Shift+º

It seems to change from one keyboard layout to another, so better look for it with Cmd+Shift+P and type "go to bracket" as others suggested.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-01-30 09:51

enter image description here

(For anybody looking how to do it in Visual Studio!)

查看更多
我只想做你的唯一
6楼-- · 2019-01-30 09:51

Please use Control + ] by placing your cursor on start or end

查看更多
唯我独甜
7楼-- · 2019-01-30 09:52

Command "editor.action.jumpToBracket" jumps between opening and closing brackets.

Here is the command's default key binding as seen in window Default Keyboard Shortcuts accessed from File | Preferences | Keyboard Shortcuts:

{ "key": "ctrl+shift+\\", "command": "editor.action.jumpToBracket",
                             "when": "editorTextFocus" }

If you're fond of quickly configuring keyboard shortcuts and VS Code settings, there are commands "workbench.action.openGlobalKeybindings" and "workbench.action.openGlobalSettings":

~/.config/Code/User/keybindings.json:

{ "key": "ctrl+numpad4", "command": "workbench.action.openGlobalKeybindings" }
{ "key": "ctrl+numpad1", "command": "workbench.action.openGlobalSettings" }
查看更多
登录 后发表回答